Help using Base SAS procedures

formats conversion

Reply
N/A
Posts: 0

formats conversion

How can a SAS formats catalog be converted to a SAS data set of variable and value labels?
Contributor
Posts: 74

Re: formats conversion

check these functions:

proc format cntlin=

and

proc format cntlout=

for input and output of formats.
N/A
Posts: 0

Re: formats conversion

This does appear to be the correct function.
Could you specify a little further for me please?

I have a formats catalog file "formats.sas7bcat" in the path "c:\"
To obtain the formats in data set "newfile.sas7bdat, would the program be something like the following?

LIBNAME PATH "C:\"
PROC FORMAT LIB = PATH CNTLOUT=NEWFILE;
RUN;

The PROC FORMAT in this case not valid, so perhaps you could advise further?
Super Contributor
Super Contributor
Posts: 3,174

Re: formats conversion

Your code appears to be correct in its current format. You will find the SAS file WORK.NEWFILE contains your unloaded formats.

The SAS documentation on PROC FORMAT has detailed information about the CNTLOUT= file contents - documentation starts here (with focus on CNTLOUT= parameter and the Output Control Data Set discussion):

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473464.htm


Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: formats conversion

You are very kind to reply. The program results in an error message on the PROC FORMAT line that the PROC option is not valid. I think it must probably something basic, but any advice is appreciated.
Super Contributor
Super Contributor
Posts: 3,174

Re: formats conversion

Post a reply and PASTE the SAS log with the code and the associated error message(s). Also, provide info about your SAS version, OS where SAS is running, and whether SAS is running local on your machine or on a remote server.

Scott Barry
SBBWorks, Inc.
SAS Super FREQ
Posts: 8,744

Re: formats conversion

Every SAS statement ends with a semi-colon, including the LIBNAME statement. I thought I would check that your lack of a semi-colon on the LIBNAME statement was a cut and paste error.

cynthia
N/A
Posts: 0

Re: formats conversion

This was the problem. Thank you.
Ask a Question
Discussion stats
  • 7 replies
  • 188 views
  • 0 likes
  • 4 in conversation