SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Chaitali09
Calcite | Level 5

Is there any option available, which allow to read the .sas file for syntax check and will not execute it.

SAS code contains both Data step and proc step.

 

Thank you!!

2 REPLIES 2
japelin
Rhodochrosite | Level 12

SAS is processed as a set by submit, from compilation to execution.
Basically, it is not possible to compile only.
It may be possible to do something similar by using an empty data set.
However, syntax errors are detected in the compile phase, but any problems with the dataset or variables are detected as errors in the execution phase, so it is not very useful unless the data is actual data.

Therefore, I sometimes test run the program with "obs= system options" or "obs= dataset options" to limit the number of observations before a time-consuming process.

SASKiwi
PROC Star

Add this statement to the top of your program:

options obs = 0 syntaxcheck;

When you run the program, no data will be processed but your code will be syntax checked. 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 663 views
  • 2 likes
  • 3 in conversation