Chapter Contents |
Previous |
Next |
SAS/CONNECT User's Guide |
Purpose |
Program |
For example, suppose that you want to perform some processing on a remote host, download the resulting SAS data set, create a permanent data set on the local host, and print a report on the local host.
The following example illustrates how to put all of these tasks into a single program.
/*************************************/ /* prepare to sign on */ /*************************************/ [1] options comamid=netbios remote=netpc; [2] libname lhost 'c:\sales\reg1'; /*************************************/ /* sign on and download data set */ /*************************************/ [3] signon; [4] rsubmit; [5] libname rhost 'd:\dept12'; proc sort data=rhost.master out=rhost.sales; where gross > 5000; by lastname dept; run; [6] proc download data=rhost.sales out=lhost.sales; run; [7] endrsubmit; [8] /*************************************/ /* print data set in local session */ /*************************************/ proc print data=lhost.sales; run;
Specify the COMAMID= and the REMOTE= system options in an OPTIONS statement. These two system options define to the local session what type of link you want to establish to which remote host. | |
Define a libref for the SAS data library on the local session where the downloaded data set should be stored. | |
Sign on to the remote host. It is not necessary to include remote-session-id when you have defined the REMOTE= system option in
a previous OPTIONS statement.
Note: This connection is not using a script file. | |
Send statements to the remote session for processing with the RSUBMIT statement. All statements are sent to the remote session until an ENDRSUBMIT statement is encountered. Although it is not necessary to include remote-session-id, using remote-session-id in the RSUBMIT statement clarifies which remote session should process a group of statements when more than one link is active. If you omit remote-session-id, the RSUBMIT statement submits the statements to the remote session that is most recently identified in a SIGNON or an RSUBMIT statement or a REMOTE= system option. | |
Define the libref for the SAS data library on the remote host. | |
The PROC DOWNLOAD step transfers the data from the library on the remote host (RHOST) to the library on the local host (LHOST). | |
The ENDRSUBMIT statement signals the end of the block of statements that is to be submitted to the remote session. Statements following the ENDRSUBMIT statement are processed by the local session. | |
The PROC PRINT step executes in the local session and reads the SAS data set that was downloaded in the PROC DOWNLOAD step. |
Running the Program |
You have several options for running this program:
Note: When statements are submitted to the remote host, several statements may be grouped into a single packet of data sent to the remote host. Therefore, a line that is
remote-submitted is not necessarily processed immediately after you enter
it on the local host.
sas file-containing-program
Note: Refer to Starting and Stopping SAS/CONNECT Software for more information about automatic logon
scripts.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.