Warm tip: This article is reproduced from stackoverflow.com, please click
sas

list all SAS members in a ZOS libray from remote sas session

发布于 2020-03-27 10:17:52

On our ZOS (mainframe) we have a library called USER.PGM.WEEKLY where several sas programs(members) are located

I am trying to retrieve a list of all the member from my PCSAS with following code

rsubmit;

proc source indd='C009BSA.BSA.BIBHLP.SAS' select *; print;run;


endrsubmit;
signoff;

But it errors out with

ERROR 22-322: Syntax error, expecting one of the following: ;, DIRDD, INDD, MAXIOERROR, NOALIAS, 
          NODATA, NOMEM, NOPRINT, NOSUMMARY, NOTSORTED, NULL, OUTBLK, OUTDD, PAGE, PRINT, 
          SEARCH.  

ERROR 180-322: Statement is not valid or it is used out of proper order.

I have tried to google around to find the solution but haven't been able to sort it out.

How ever i am able to download one member at the time by running

filename inpds 'USER.PGM.WEEKLY' shr;
 proc download infile =inpds(PPRINT_TO_PDF) 
 outfile='L:\Work\PPRINT_TO_PDF';
 run;
Questioner
havmaage
Viewed
34
Tom 2019-07-03 21:41

Try something like this. You might need to use an actual physical file instead of using the TEMP filename engine on ZOS.

filename dirlist temp;
rsubmit;
  filename dirlist temp;
  proc source indd='C009BSA.BSA.BIBHLP.SAS' dirdd=dirlist; run;
  proc download infile=dirlist outfile=dirlist; run;
endrsubmit;

https://v8doc.sas.com/sashtml/os390/z0217440.htm

If you just want to download all of the members of the PDS then PROC DOWNLOAD can do that for you without you needing to have the list of members.

filename outdir '/where/I/want/to/write/';
rsubmit;
  filename indir 'C009BSA.BSA.BIBHLP.SAS';
  proc download infile=indir(*) outfile=outdir; run;
endrsubmit;