{smcl} {* 19Nov2008}{...} {cmd:help wfdo_debug}: Steps for debugging a do-file {hline} {title:When all else fails...} {synoptset 8 tabbed}{...} {p2colset 3 11 11 2}{...} {p2col:{bf:Step 1:}}Update Stata and user written programs (see {helpb update} and {helpb adoupdate}).{p_end} {p2col:{bf:Step 2:}}Start with a clean slate: run {cmd:clear all} and {cmd:macro drop _all}; restart Stata; reboot your computer; and even try using another computer.{p_end} {p2col:{bf:Step 3:}}Try your program with a different dataset and with different variables. If the problem disappears, it is probably caused by the specific variables or dataset you are using.{p_end} {p2col:{bf:Step 4:}}Assume everything could be wrong. Double check parts of the do-file that you are {it:sure} are right.{p_end} {p2col:{bf:Step 5:}}Run the program in steps by using {cmd:/* */} to exclude parts of the do-file.{p_end} {p2col:{bf:Step 6:}}Start over: throw out all of the original code; create a new do-file with a different name; try alternative approaches to obtain the same analyses.{p_end} {p2col:{bf:Step 7:}}Ask for help (see {helpb wfdo_help}).{p_end} {p2colset 5 12 12 2} {title:Also see} {helpb wfdo:WF-do-files}; {helpb wf:Workflow} INCLUDE help wf_footer