BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Charlotte37
Fluorite | Level 6

Hello,

 

We have SAS chains that are triggered automatically at different times.
These chains call several SAS programs (via "include"). These chains can call N programs that do not depend on each other.
Currently, if the N1 program contains errors then the rest of the chain doesn't execute correctly because : "PROC SQL set option NOEXEC and will continue to check the syntax of statements."
 
We tried the EXEC and NOERRORSTOP options without success.
 
We need the programs run correctly even if the previous one had an error. Can you help us, please ?
 
Thanks,
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
4 REPLIES 4
ballardw
Super User

So what type of errors are these? There are at least 20 system options related to different types of errors not to mention return codes set by procedures that can be used to conditionally do things

 

If your data contains values that your program can't handle, such as missing variables or no values, or missing/zero observation data sets that is pretty much up to you to make sure the data is acceptable before dumping the data into a procedure. If the variable types are incorrect then you have an issue further back in your process that is allowing incorrect data types to be created.

 

SASKiwi
PROC Star
options nosyntaxcheck;

Is probably what you need: https://documentation.sas.com/?docsetId=lesysoptsref&docsetTarget=n014qbvh3po8w5n1qlqbzr22vtg0.htm&d...

 

SYNTAXCHECK is the default setting for batch jobs.

Patrick
Opal | Level 21

"These chains call several SAS programs (via "include"). These chains can call N programs that do not depend on each other."

%include allows you to execute code stored in multiple files but the code gets still executed as one single program. There are syntax errors like unbalanced quotes or things like an abort statement in code from which you can't easily or not at all recover whatever "tricks" you use.

 

If you would execute these programs each in their own environment then your problem would just go away. Options to do so:

A) Use a scheduler and build flows (1 per chain). SAS Management Console allows you to do so.

B) Use SAS/Connect (if licensed) and call your programs within rsubmit blocks

C) Use an X command (or %sysexec) to issue OS level batch commands to run your programs (requires option XCMD set)

 

Any of above 3 options will execute the programs independently from each other. All options also allow you to execute some or all of the programs in parallel.

 

If you execute everything together then it's not only about syntax errors but also that a previous program can change the environment for the next %included program - all the work tables, options changed, global macro variables created will still exist when the "2nd" program executes.

 

Charlotte37
Fluorite | Level 6

Hello,

 

We tried the 'nosyntaxckeck' option and it seems to work.

 

Thank you very much,

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1438 views
  • 2 likes
  • 4 in conversation