BookmarkSubscribeRSS Feed
GeorgeSAS
Lapis Lazuli | Level 10

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;

 

9 REPLIES 9
ballardw
Super User

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;
SASKiwi
PROC Star

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;
Patrick
Opal | Level 21

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

SASKiwi
PROC Star

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

 

Patrick
Opal | Level 21

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

SASKiwi
PROC Star

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

LinusH
Tourmaline | Level 20
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
Tom
Super User Tom
Super User

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;

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 1640 views
  • 0 likes
  • 6 in conversation