Hello all;
I want to download a sas format whose name is Pubfmt from mainframe to pc. the catalog name in mainframe is MFlib.
I can downloas the whole catalog formats but I don't know how to select the format that I want to download only. please help me.
Thanks!
rsubmit; libname MFlib "A0001.B00.library" disp=shr; proc download incat=MFlib.formats outcat=myPClib.formats ; **select Pubfmt; /*this not work*/ run; endrsubmit;
I would probably create a cntlout data set using proc format and Select and then move the data set.
proc format library=work cntlout=work.myformatdata ; select formatname; run;
Move the work.myformatdata set to the target system and then use proc format with the cntlin option to recreate it. That way I always have the data.
The other option is using proc cport to create a transport file and then use proc cport on the other side to read the transport file. A generic example:
libname source 'sas-library'; filename tranfile 'transport-file' host-option(s)-for-file-characteristics; proc cport catalog=work.formats file=tranfile; select formatname; run;
You can use PROC CATALOG to copy the required format into a temporary catalog then download that:
proc catalog cat=mflib.formats;
copy out=work.formats;
select pubfmt.format;
run;
quit;
Just copying catalogs won't work in this case.
I believe you've missed that this is about moving catalogs from Mainframe to PC.
@Patrick - thanks for the feedback. However I use the method I've suggested myself although its from Windows to Windows. PROC CATALOG allows you to select specfic formats, then PROC DOWNLOAD allows you to move that catalog between SAS servers taking care of catalog conversions between operating systems. I'm not able to test this across different OS's myself but I'm keen for the OP to confirm if it does work.
Also I just found this example that allows you to do the selection with just PROC DOWNLOAD:
As far as I know format catalogs required even conversion between 32 and 64bit Windows.
http://support.sas.com/kb/44/047.html
Format catalogs certainly required conversion between Mainframe z/OS and Windows.
@Patrick - yes, agree catalogs need to be converted, but my suspicion is PROC DOWNLOAD does this on-the-fly during the transfer. PROC DOWNLOAD documentation explicitly states it can be used with FORMAT catalogs so I'm assuming it does the conversion internally.
You need to have /et= in the SELECT statement.
proc format lib=work.formats ;
value myfmt 1='Made on Local Session';
run;
signon remote=r1 sascmd='!SASCMD' ;
rsubmit r1;
proc format lib=work.formats;
value myfmt 1='Made on Remote Session';
run;
proc download incat=work.formats outcat=work.formats;
select myfmt / et=format;
run;
endrsubmit ;
signoff r1;
proc format fmtlib lib=work.formats;
select myfmt ;
run;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.