With SAS, it’s almost always the semicolons!

With SAS, it’s almost always the semicolons!

I read that recently–I can’t remember where now (if you wrote it, let me know–I’ll link!).

I spent the day at Cornell doing SAS programming;  I kept expecting Andy Bernard to show up.

Anyway, I was reminded of that quote because, as you guessed it, it was almost always that I forgot a semicolon when I got a SAS error.  The errors never mention a semicolon, but that is always the first thing to check for.

I was also reminded today that another common mistake is to forget the SET statement when creating a new data set.  If SAS tells you your variables don’t exist, but you know they do, it’s because you forgot the SET statement.

I was also reminded of my best SAS time saver ever.  F12: output;cle;log;cle;wpgm.  At first I set it up wrong and was lost for a few minutes without it.  Luckily I discovered my mistake pretty quickly.

Reader Interactions

Leave a Reply

Your email address will not be published.

Please note that, due to the large number of comments submitted, any questions on problems related to a personal study/project will not be answered. We suggest joining Statistically Speaking, where you have access to a private forum and more resources 24/7.