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?

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1871 views
  • 0 likes
  • 3 in conversation