![]() Chapter Contents |
![]() Previous |
![]() Next |
SAS/CONNECT User's Guide |
Purpose |
You can also use the %SYSRPUT macro statement 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 a PROC DOWNLOAD step has successfully completed before beginning another step on either the remote host or the local host.
Program |
Suppose that you have a transaction file on your local host and you want to upload it to the remote host, and then use it to update a master file. You can test the results of the PROC UPLOAD step on the remote host by checking the value of the SYSINFO macro variable.
The SYSINFO macro variable can be used to determine if the transaction file was successfully uploaded. If successful, the master file is updated with the new information. If the upload was not successful, you receive a message that explains the problem.
You can use the %SYSRPUT macro statement to send the return code from the remote host back to the local session. Your SAS session on the local host can test the results of the upload and, if it is successful, use the DATASETS procedure to archive the transaction data set.
[1] libname trans 'local-SAS-data-library'; libname backup 'local-SAS-data-library'; [2] rsubmit; [3] proc upload data=trans.current out=current; run; [4] %sysrput upload_rc=&sysinfo; %macro update_employee; [5] %if &sysinfo=0 %then %do; libname perm 'remote-SAS-data-library'; data perm.employee; update perm.employee current; by employee_id; run; %end; [6] %else %put ERROR: UPLOAD of CURRENT failed. Master file was not updated.; %mend update_employee; [7] %update_employee; endrsubmit; [8] %macro check_upload; [9] %if &upload_rc=0 %then %do; [10] proc datasets lib=trans; copy out=backup; run; %end; %mend check_upload; [11] %check_upload;
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
[10] When the transaction data set has been successfully uploaded and added to the master data set, the transaction file can be archived on the local host by using the COPY statement in the DATASETS procedure. | |
[11] Executes the CHECK_UPLOAD macro on the local host. |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.