Chapter Contents |
Previous |
Next |
SAS/CONNECT User's Guide |
Purpose |
Program |
/************************************/ /* Name: DISTREPORT.SCL */ /* */ /* This program distributes reports */ /* to the franchise offices. */ /************************************/ length rc 8; INIT: submit continue; /************************************/ /* set up distribution macro */ /************************************/ [1] %macro distribution; [2] %let franchise_city= Atlanta NYC LA Dallas Chicago; %let franchise_host= tsoatl unixnyc unixla wntdal cmshq; [3] %let j=1; %do %while(%scan(&franchise_city,&j) ne ); %let nextfran=%scan(&franchise_city,&j); %let nextrem=%scan(&franchise_host,&j); ... %let j=%eval(&j+1); %end; [4] options remote=&nextrem comamid=communication-access-method; filename rlink 'script-file-name'; signon; [5] x "alloc fi(xferrpt) da('sasinfo.sugi18.xferrpt') shr"; [6] rsubmit; filename frptlib "d:\counter\reports\prod"; endrsubmit; /************************************/ /* use SAS/CONNECT server */ /************************************/ [7] libname rpt "d:\counter\reports" server=&nextrem; [8] data _null_; set rpt.preport end=finish; file xferrpt; if _n_ =1 then put "rsubmit;"; /*********************************/ /* transfer desired reports */ /* named by variable name in */ /* reports data set */ /*********************************/ [9] if (copy="Y") then do; put "proc upload infile= 'sasinfo.sugi18."name"'"; put "outfile=frptlib("name") status=no;run;"; end; if finish then put "endrsubmit;"; run; /************************************/ /* upload desired reports */ /************************************/ [10] %include xferrpt; signoff; %end; %end; %mend; /************************************/ /* invoke macro to distribute */ /* reports */ /************************************/ [11] %distribution; endsubmit; _status_='H'; return; MAIN: return; TERM: return;
Begin the distribution macro definition. | |
Initialize the list of remote franchise offices (
franchise_city ) and their node names (
franchise_host ) to be used as the REMOTE= value. | |
Scan to the next office and node name to be processed. | |
Specify the remote office nodename as the REMOTE= value and sign on to the remote franchise. | |
Allocate an OS/390 file that will contain generated UPLOAD statements. | |
Remote submit a fileref to define the PC library to which reports will be uploaded. | |
Connect to single-user server to access the library that contains the report-selection data set. | |
Execute the DATA step to evaluate report-selection data (RPT.PREPORT) and create UPLOAD statements to transfer reports (XFERRPT). | |
If the selection criterion is yes, create the appropriate PROC UPLOAD statement for the particular report. | |
[10] Include the generated SAS job in the local OS/390 SAS session for execution. | |
[11] Invoke the macro. |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.