07-18-2012 03:14 PM
Counting the number of semicolons will get you close. However, one can put in a bare semicolon. It is effectively a "null" statement so I am not sure how useful that would be to your (unstated) need.
Also, when you have data inline with the program, there can be semicolons in the data that are not statements (that were you see the "card4" statement.)
Lastly, one can have semicolons in literals and they are not statements.
07-19-2012 08:52 AM
Let's muddy the waters a bit more then. What if the program calls a macro? Each macro call can generate thousands of SAS statements. The macro call itself may not contain a semicolon at all, but the generated statements certainly will. Should that add to your statement count?
07-19-2012 11:59 AM
Thank you! I am a beginner and preparing for sas base exam. Therefore, the question I asked are based on some very simply sas programs. I didn't think that what I asked might not be correct in so many cases. But their anwsers are helpful for my future study.