How to Debug the SAS code
Debugging SAS code Direct link: http://ssc.utexas.edu/consulting/answers/sas/sas54.html Question: I have a huge SAS program that isn't working. The results I get are not right but there are no errors or warnings in the SAS log. How can I figure out where I went wrong? Answer: To debug a SAS program that produces no syntax errors, follow these six steps: 1. Check to see that your original data input is correct for all variables. 2. If the data is input to SAS correctly, go to the other end of the program. Select a variable or a small set of variables involved in the analyses where you get the wrong results. Use PROC FREQ, PROC MEANS, and/or PROC PRINT to examine these variables. There should be a problem with at least one; identify exactly how these variables are incorrect. 3. Now follow these variables back through each operation you performed, always looking at the characteristics in question. In this way you can narrow down the exact step where an error occurs. Prior to the qu...