Examples of Combining Compute Services and Data Transfer Services |
Purpose |
The SAS/CONNECT statements SIGNON, SIGNOFF, RSUBMIT, and ENDRSUBMIT enable you to submit statements from a client session to a server session. You can include these statements in a SAS program and do both client and server processing within a single SAS program. This program can be run in an interactive line mode SAS session, in a non-interactive SAS session, or by including the program in a client session. In each case, the program executes statements in both the client and server sessions.
Program |
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;
Running the Program |
You have several choices for running this program:
Type and submit each line in an interactive line mode SAS session. All of the statements between the RSUBMIT and ENDRSUBMIT statements are submitted to the server session for processing. All other statements are processed in the client session.
Note: When statements are submitted to the server session, several statements can be grouped into a single packet of data that is sent to the server session. Therefore, a line that is remote submitted is not necessarily processed immediately after you enter it in the client session.
Build a file that contains all these statements, and use a %INCLUDE statement to include the file in an interactive line mode session. The file is processed immediately.
Build a file that contains all these statements and run a non-interactive SAS job to process the statements as follows:
sas file-containing-program
Build a file that contains all these statements, and use an INCLUDE command to include the file. You must submit the included statements from the windowing environment.
Build a file and issue the SUBMIT command from the Explorer window. For details, see Using SAS Explorer to Monitor SAS/CONNECT Tasks.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.