BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
python_user
Fluorite | Level 6

Hi,

 

Sorry if this has been answered. Our databases have formatc files separate from the data files. These are formatc files I can display in the html view, and I want to export their values to a csv file so I can use them outside of sas.

In short, how do I make a LUT csv from the formatc files.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

It is not clear what you are talking about.  If you have a SAS dataset then it is easy to make CSV file.  PROC EXPORT for example.

If you have a FORMAT catalog you can use PROC FORMAT to generate a SAS dataset with the format definitions.  You can then make a CSV file from the dataset.

libname mylib 'my-path';
proc format noprint lib=mylib.mycatalog cntlout=my_formats; run;
proc export data=my_formats dbms=csv
  file="my_formats.csv" replace
;
run;

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

It is not clear what you are talking about.  If you have a SAS dataset then it is easy to make CSV file.  PROC EXPORT for example.

If you have a FORMAT catalog you can use PROC FORMAT to generate a SAS dataset with the format definitions.  You can then make a CSV file from the dataset.

libname mylib 'my-path';
proc format noprint lib=mylib.mycatalog cntlout=my_formats; run;
proc export data=my_formats dbms=csv
  file="my_formats.csv" replace
;
run;
python_user
Fluorite | Level 6

Thanks,

 

The " proc format noprint lib=fmt_file cntlout=data_out;" is what I was missing

 

ballardw
Super User

By "formatc" file do you mean a SAS format catalog?

If so you can create a data set from the catalog using the Format procedure with the cntlout=datasetname option and then use the approach posted by @Tom 

Something like:

proc format library=libname.catname cntlout=work.catnameformats;
run;

where libname is the library containing the catalog catname is the name of the catalog.

 

If the file is not a SAS format catalog then we need some info such as are these SAS data sets?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 1482 views
  • 0 likes
  • 3 in conversation