Hello
So I just received a dataset with formats from someone. I can't seem to read in the formats.
I have received 2 files data.sas7bdat and formats.sas7bcat.
So I wrote the following code:
LIBNAME TCCTM 'C:\Data';
LIBNAME TCCTMFMT 'C:\Data';
proc format Library=TCCTMFMT.formats; run;
It ran with no error. But when I open up the dataset I get a series of "Errors: Format FORMAT1 not found or couldn't be loaded for variable VAR1."
I have also tried the CNTLIN command instead of the library command and I get the following error: ERROR: File TCCTM.FORMATS.DATA does not exist.
I did open the format file in SAS (using the SAS explorer), I see the FORMAT1 does exist in the file. So I am thinking I am reading in the format incorrectly. Can someone tell me how to do it correctly?
In addition, how can I tell what value is associated with each format? for example, if the format for education is 1=high school, 2=college 3=grad school.. I know with formats, I will only see the naming. How do I see numerical value associated with the format without removing the format?
Thanks!
You need to use the FMTSEARCH system option to specify the search order for format libraries if the format libraries are not in the Work library or the Library library.
Add this options statement :
options fmtsearch=(tcctm tcctmfmt);
You need to use the FMTSEARCH system option to specify the search order for format libraries if the format libraries are not in the Work library or the Library library.
Add this options statement :
options fmtsearch=(tcctm tcctmfmt);
Try submitting the FMTSEARCH= system option as shown below in your SAS session before opening the data set in SAS Explorer.
LIBNAME TCCTM 'C:\Data';
options fmtsearch=(TCCTM);
SAS will now look in the TCCTM library for the format in the file: formats.sas7bcat and the formatted values should appear instead of the error when you attempt to open the data set from the Explorer window. For more helpful details about format catalogs, please see: Usage Note 37332: General information about storing and retrieving user-defined formats http://support.sas.com/kb/37332
If you want to see the contents of each format, add one word to the end of your PROC FORMAT statement: FMTLIB
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!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.