01-11-2013 03:11 PM
I'll premise by saying I am a very new SAS user.
Today I needed to debug some logic statements. Ordinarily in VBA I would execute the code in step mode (F8), and be able to see which statements/variables/calculations would be tripping me up. Is there any equivalent to this in SAS? If not, how would you recommend debugging long logic statements?
01-11-2013 03:14 PM
Or you can end your program in certain places (Add run early) and/or add put statements in relevant locations to see the status of variables through the data step.
You can also post here
01-11-2013 03:33 PM
Another quick and dirty method is to add this statement just before your DATA step:
However, you might want to make sure that you won't destroy any permanent SAS data sets by replacing them with 0 observations.
Also, you have to realize that debugging tricky logic means more than getting rid of the error messages. Even without error messages, there is the question of whether the logic does the right thing. You may need to devise some data that will test what you expect the logic to do.