![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS Companion for the CMS Environment |
| RC Variable |
The RC variable is set in a slightly different way for a SASMACRO. The strings that are submitted to SAS are not necessarily complete execution units. SAS collects SAS language elements until it encounters a RUN statement, at which point it runs the SAS step. The RC variable is set to 0 when partial program fragments are submitted. The SAS return code is assigned to the REXX variable RC only for the string that contains the RUN statement.
| RC Values |
The following RCTEST SASMACRO demonstrates when the REXX variable RC gets set:
/* RCTEST SASMACRO - a SAS REXX macro */ /* Show SAS statements in the log */ '++SASLOG' 'data x;' 'do i = 1 to 10;' 'output;' /* show rc in the SAS log */ '++SASLOG The RC value is:' rc 'run;' /* show rc in the SAS log */ '++SASLOG The RC value is:' rc exit
SAS Log for RCTEST shows the resulting SAS log.
1 rctest;
++++ data x;
++++ do i = 1 to 10;
++++ output;
++++ The RC value is: 0
++++ run;
5 run;
-
117
ERROR 117-185: There were 1 unclosed DO blocks.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.X may be incomplete. When this step was stopped,
there were 0 observations and 1 variables.
++++ The RC value is: 1012 |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.