I'm trying to find the SAS system option to capture the status of program in a variable. I tried with &SYSERR and &SYSRC but it is not producing the desired result. In the below example I would except &SYSERR to return code as 4 (SYSERR code for warning message) instead of 0 (which denotes successful execution without any warning message). Same is the case if I replace &SYSERR with &SYSRC.
I could see that &SYSERR is generating the value 0 if I place &SYSERR at the end of the data step in the below program.
2097 %PUT &SYSERR;
0
2098 /*derive operationl metadata*/
2099 data metadata;
2100 set vars;
2101 /*Solution Component Name derivation*/
2102 if find("&etls_jobName","_INPUT_",'_') > 0
2103 then SOLN_CMPNT_NM= "DATA IMPORT";
2104 else if find("&etls_jobName","_EXPORT_") > 0
2105 then SOLN_CMPNT_NM = "DATA EXPORT" ;
2106 else if find("&etls_jobName","_LOA_") > 0
2107 then SOLN_CMPNT_NM = "DATA LOADER" ;
2108 else if find("&etls_jobName","_TRA_") > 0
2109 then SOLN_CMPNT_NM = "DATA TRANSER" ;
2110 else SOLN_CMPNT_NM = "OTHER" ;
2111 /*Job return code*/
2112 /*%PUT &SYSRC.;*/
2113 run;
WARNING: In a call to the FIND function or routine, the modifier "_" not valid.
NOTE: There were 1 observations read from the data set WORK.VARS.
NOTE: The data set WORK.METADATA has 1 observations and 10 variables
... View more