The %SYSRPUT macro statement is submitted with
SAS/CONNECT to a remote host to
retrieve the value of a macro variable stored on the remote host.
%SYSRPUT assigns that value to a macro variable on the local host.
%SYSRPUT is similar to the %LET macro statement because it assigns
a value to a macro variable. However, %SYSRPUT assigns a value to
a variable on the local host, not on the remote host where the statement
is processed. The %SYSRPUT statement places the macro variable in
the current scope of the local host.
Note: The names of the macro variables
on the remote and local hosts must not contain a leading ampersand.
The %SYSRPUT statement
is useful for capturing the value of the automatic macro variable
SYSINFO and passing that value to the local host. SYSINFO contains
return-code information provided by some SAS procedures. Both the
UPLOAD and the DOWNLOAD procedures of
SAS/CONNECT can update the macro variable SYSINFO and set it to
a nonzero value when the procedure terminates due to errors. You can
use %SYSRPUT on the remote host to send the value of the SYSINFO macro
variable back to the local SAS session. Thus, you can submit a job
to the remote host and test whether a PROC UPLOAD or DOWNLOAD step
has successfully completed before beginning another step on either
the remote host or the local host.
To use %SYSRPUT, you
must have invoked a remote SAS windowing environment session by submitting
the DMR option with the SAS command. For details about using %SYSRPUT,
see the
SAS/CONNECT documentation.
To create a new macro
variable or to modify the value of an existing macro variable on a
remote host or a server, use the %SYSLPUT macro statement.