SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Transfer files from Mainframe to PC

Reply
Regular Contributor
Posts: 208

Transfer files from Mainframe to PC

[ Edited ]

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! 

Super User
Posts: 10,516

Re: Transfer files from Mainframe to PC

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.

 

Super User
Posts: 5,260

Re: Transfer files from Mainframe to PC

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
Regular Contributor
Posts: 208

Re: Transfer files from Mainframe to PC

If I use ftp transfer SAS data set from mainframe.I can only transfer the folder which I can't open in PC.
Super User
Super User
Posts: 6,502

Re: Transfer files from Mainframe to PC

[ Edited ]

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;

 

Ask a Question
Discussion stats
  • 4 replies
  • 159 views
  • 0 likes
  • 4 in conversation