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. 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 828 views
  • 2 likes
  • 3 in conversation