DATA Step, Macro, Functions and more

download a specific format

Reply
Regular Contributor
Posts: 241

download a specific format

[ Edited ]

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;

 

Super User
Posts: 11,343

Re: download a specific format

Posted in reply to GeorgeSAS

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;
Super User
Posts: 3,254

Re: download a specific format

[ Edited ]
Posted in reply to GeorgeSAS

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;
Respected Advisor
Posts: 4,173

Re: download a specific format

@SASKiwi

Just copying catalogs won't work in this case.

I believe you've missed that this is about moving catalogs from Mainframe to PC. 

Super User
Posts: 3,254

Re: download a specific format

[ Edited ]

@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:

 

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

 

Respected Advisor
Posts: 4,173

Re: download a specific format

[ Edited ]

@SASKiwi

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.

Super User
Posts: 3,254

Re: download a specific format

@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. 

Respected Advisor
Posts: 4,173

Re: download a specific format

Posted in reply to GeorgeSAS
Super User
Posts: 5,429

Re: download a specific format

Posted in reply to GeorgeSAS
PROC DOWNLOAD with SELECT should be sufficient for this operation.
http://support.sas.com/documentation/cdl/en/connref/69581/HTML/default/viewer.htm#n1ovuuukyo8jxan0zb...
Data never sleeps
Super User
Super User
Posts: 7,050

Re: download a specific format

Posted in reply to GeorgeSAS

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;
Ask a Question
Discussion stats
  • 9 replies
  • 215 views
  • 0 likes
  • 6 in conversation