Help using Base SAS procedures

How many SAS statements are there in a SAS program?

Reply
Occasional Contributor
Posts: 5

How many SAS statements are there in a SAS program?

I am a beginner. For some simple sas program, should I always count the number of semicolons?
Thanks!

Super Contributor
Posts: 1,636

Re: How many SAS statements are there in a SAS program?

Yes. I agree.

Trusted Advisor
Posts: 2,113

Re: How many SAS statements are there in a SAS program?

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.

Occasional Contributor
Posts: 5

Re: How many SAS statements are there in a SAS program?

If we exclude the last two cases you mentioned, is a "null" statement also one type of statement?

Thank you!

Super User
Posts: 9,687

Re: How many SAS statements are there in a SAS program?

One situation you need to consider is Annotation ( /* */  * ...; ) which can also contain many semicolon .

Super User
Posts: 5,093

Re: How many SAS statements are there in a SAS program?

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?

Frequent Contributor
Posts: 91

Re: How many SAS statements are there in a SAS program?

And some more mud.  What about semicolons in quoted strings?

Super User
Posts: 10,538

Re: How many SAS statements are there in a SAS program?

And don't forget the contents of %INCLUDE files;

How will this information be used? That might helpfilter responses.

Occasional Contributor
Posts: 5

Re: How many SAS statements are there in a SAS program?

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.

Ask a Question
Discussion stats
  • 8 replies
  • 419 views
  • 8 likes
  • 7 in conversation