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!!
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.
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.