BookmarkSubscribeRSS Feed
GeorgeSAS
Lapis Lazuli | Level 10

Hello,

 

I use SAS in pc and mainframe.

I have 3 JCL FILES at mainframe under AAAAAAAA.BBBBBBBB.MYLIBS.PDS

 

I want to transfer the three jcl files(please note, I want transfer regular files, not SAS dataset) from mainframe to my pc. please help me on my code:

 

 

LIBNAME pc_lib "C:\TEMP5";

%connect(...,...);/*a macro can connect to mainframe*/

rsubmit remote=abasa;
libname M_lib    "AAAAAAAA.BBBBBBBB.MYLIBS.PDS";

proc download inlib=M_lib outlib=pc_lib;
run;


endrsubmit;
 signoff;

Thanks! 

4 REPLIES 4
ballardw
Super User

What help do you want?

Did you get an error, warning or no result ? POST the LOG with the submitted code. XXXX out any sensitive bits before posting though.

 

LinusH
Tourmaline | Level 20
If you are downloading non SAS files you shouldn't use a libname and in/outlib references. Just file=.
Be aware of encoding issues.
Data never sleeps
GeorgeSAS
Lapis Lazuli | Level 10
If I use ftp transfer SAS data set from mainframe.I can only transfer the folder which I can't open in PC.
Tom
Super User Tom
Super User

You should be able to use FTP to transfer the members of a Mainframe PDS the same way that you can transfer individual files from a directory on windows or linux computer. You should be able to use cd command and/or the mget command.

cd AAAAAAAA.BBBBBBBB.MYLIBS.PDS
mget *

or 

mget AAAAAAAA.BBBBBBBB.MYLIBS.PDS(*)

 

That said you can use PROC DOWNLOAD to copy the files. There is even an example in the documentation.

http://support.sas.com/documentation/cdl/en/connref/69581/HTML/default/viewer.htm#p0kysiltpwwgbon1uz...

Basically make a local fileref that points to the folder you want to write the files and a remote fileref that points to the PDS.

filename locdir 'some_local_directory';
rsubmit;
  filename inpds 'mfhost.sas.programs' shr;
  proc download infile=inpds('*') outfile=locdir;
  run;
endrsubmit;

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 3398 views
  • 0 likes
  • 4 in conversation