08-04-2017 01:19 PM - edited 08-04-2017 01:21 PM
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.
rsubmit; libname MFlib "A0001.B00.library" disp=shr; proc download incat=MFlib.formats outcat=myPClib.formats ; **select Pubfmt; /*this not work*/ run; endrsubmit;
08-04-2017 01:37 PM
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;
08-04-2017 08:21 PM - edited 08-04-2017 08:24 PM
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;
08-04-2017 11:53 PM - edited 08-05-2017 12:08 AM
@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:
08-05-2017 03:18 AM - edited 08-05-2017 03:19 AM
08-05-2017 11:26 PM
@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.
08-05-2017 05:52 PM
08-06-2017 10:37 AM
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;