BookmarkSubscribeRSS Feed
ranniefung
Calcite | Level 5

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

8 REPLIES 8
Doc_Duke
Rhodochrosite | Level 12

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.

ranniefung
Calcite | Level 5

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

Thank you!

Ksharp
Super User

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

Astounding
PROC Star

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?

advoss
Quartz | Level 8

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

ballardw
Super User

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

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

ranniefung
Calcite | Level 5

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1551 views
  • 8 likes
  • 7 in conversation