Chapter Contents

Previous

Next
%SYSLPUT Statement

%SYSLPUT Statement



Creates a macro variable on the remote host.

Local


Syntax
Syntax Description
Example 1
Example 2

Syntax

%SYSLPUT macro-variable=value;

Syntax Description

macro-variable
specifies the name of a macro variable on the remote host.

value
is an alphanumeric string that will be assigned to the remote macro-variable, which should not contain nested quotation marks.

Details

%SYSLPUT submits a macro assignment statement to the remote host to assign a value that is available on the local host to a macro variable that is accessed on the remote host. If you are signed on to multiple remote hosts, &SYSLPUT goes to the most recently used remote session. If you are signed on to only one host, &SYSLPUT goes to that host. If you are not signed on to any host, an error condition results.

Note:   %SYSLPUT performs the opposite function of %SYSRPUT. It creates a macro variable in the remote environment based on a value in the local environment.  [cautionend]

macro-variable can be a macro variable reference or a character string. The %SYSLPUT statement is similar to the %LET statement because it assigns a value to a macro variable; however, the %SYSLPUT statement assigns a value to a variable on the remote host, not on the local host where the statement is processed. The %SYSLPUT statement places the macro variable into the current referencing environment of the remote host.


Example 1

This example illustrates how to set the macro variable FLAG to 1 on the only remote session.

%syslput flag=1;


Example 2

This example sets the macro variable REMDIR1 on the local host to the path of a directory located on the remote host. The macro statement %SYSLPUT is then used to create the macro variable REMDIR2 on the remote host with the same value as REMDIR1. PROC UPLOAD is used to transfer the data set ENG101 from the WORK library of the local host to the REMDIR2 directory on the remote host.

%let remdir1=/dept/engineering/staff/dr_smith;
%syslput remdir2=remdir1;
rsubmit;
   proc upload infile= eng101
      outfile="&remdir2/eng101";
   run;
endrsubmit;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.