Example 8: Forcing Macro Variables to Be Defined When %SYSRPUT Executes

Purpose

In MP CONNECT processing, by default, macro variables in an RSUBMIT block are defined only when a synchronization point is encountered. In order to force macro variables to be defined when the %SYSRPUT macro variable executes, specify CSYSRPUTSYNC=YES in each RSUBMIT statement.
CAUTION:
If the values that are specified in the CSYSRPUTSYNC= option differ between consecutive RSUBMIT blocks, the latter value supersedes the former value.
If the SYSRPUTSYNC system option is specified, the CSYSRPUTSYNC= option in the RSUBMIT statement takes precedence. If the CSYSRPUTSYNC= option in an RSUBMIT block is omitted, the value for the system option is applied.
In the following program, the CSYSRPUTSYNC=YES option is specified in each RSUBMIT block in order to force macro variables to be defined for each %SYSRPUT macro variable execution. Without an explicit setting of CSYSRPUTSYNC=YES in each RSUBMIT block, a default value is provided by the SYSRPUTSYNC system option. The default is CSYSRPUTSYNC=NO, which causes macro variables to be defined when synchronization points are encountered.

Program

signon smp sascmd="!sascmd -logparm 'write=immediate' -nosyntaxcheck";
     options cwait=no;

/* -----------  first RSUBMIT block  ----- */
     rsubmit csysrputsync=yes;
       data a;
       do i=1 to 100;
       x=ranuni(0);
       output;
       end;
       run;

     %sysrput done=a;
     endrsubmit;

/* ----------- second RSUBMIT block  ----- */
     rsubmit csysrputsync=yes;
       data b;
       do i=1 to 100;
       x=ranuni(0);
       output;
       end;
       run;

     %sysrput done=b;
     endrsubmit;

/* ----------- third RSUBMIT block  ----- */
     rsubmit csysrputsync=yes;
       data c;
       do i=1 to 100;
       x=ranuni(0);
       output;
       end;
       run;

     %sysrput done=c;
     endrsubmit;

     waitfor smp;
     %put done=&done