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!
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;
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;
Thanks,
The " proc format noprint lib=fmt_file cntlout=data_out;" is what I was missing
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?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.