I'm trying to figure out how to trigger a SAS code "error" when I run a X command that has an error return code.
I am running a Unix script in my sas code. If the Unix script fails, there is no warning, and Enterprise Guide keeps processing the sas code. I am able to capture the return code of the script by referencing the macro variable &sysrc. I'm not sure how to force Enterprise Guide to trigger an error state based on the &sysrc code from the Unix script. I would like Enterprise Guide to throw an error similar to the type of error when a data step bombs.
I am thinking that there may be a way to re-assign the SASERR macro variable to my own value, but I'm not sure how to do it.
"there may be a way to re-assign the SASERR macro variable to my own value". I don't use EG much, but in code I would write %let _sysrc=&sysrc; to capture the error return code and then use &_sysrc to check the error condition. You can do the same thing with &syserr. Good luck.
another route : use call execute() to conditionally generate a syntax error condition. Perhaps this might work/fail adequately [pre]DATA _NULL_ ;
if ( conditions like &_sysrc that determine task failure) then
CALL EXECUTE( 'data 123; run;' ) ;