This program processes
data on a server, downloads the resulting SAS data set, creates a
permanent data set in the client session, and prints a report in the
client session.
/*************************************/
/* prepare to sign on */
/*************************************/1
options
comamid=tcp
remote=netpc; 2
libname lhost 'c:\sales\reg1';
/*************************************/
/* sign on and download data set */
/*************************************/3
signon;4
rsubmit;5
libname rhost 'd:\dept12';6
proc sort data=rhost.master
out=rhost.sales;
where gross > 5000;
by lastname dept;
run;
7
proc download data=rhost.sales
out=lhost.sales;
run;8
endrsubmit;
9
/*************************************/
/* print data set in client session */
/*************************************/
proc print data=lhost.sales;
run;
1 Specifies the COMAMID= and the
REMOTE= system options in an OPTIONS statement. These two system options
define the connection between the client and server sessions.
2 Defines a libref for the SAS library in the client session to identify
the location of the data set to be downloaded.
3 Signs on to the server session. The server-ID was specified in the preceding OPTIONS statement.
Note: A script file is not used.
4 Uses
the RSUBMIT and ENDRSUBMIT statements to define statements to send
to the server for processing. If the client session is connected to
multiple active server sessions, specifying the server ID in the RSUBMIT
statement clarifies which server session should process the block
of statements. If server-ID is omitted, RSUBMIT directs the statements to the most recently
identified server session.
5 Defines the libref for the SAS library in the server session.
6 Creates the RHOST.SALES data set as a sorted subset of the RHOST.MASTER
data set.
7 Transfers the SALES data from the library in the server session
(RHOST) to the library in the client session (LHOST).
8 Marks the end of the block of statements to be submitted to the
server session. Statements that follow the ENDRSUBMIT statement are
processed in the client session.
9 Reads and prints the SAS data set that was downloaded in the PROC
DOWNLOAD step.