Hi everyone,
I recently received a series of permanent SAS datasets along with saved formats for the data (formats were saved in a folder named as formats64). However, I have not been able to view the contents of the datasets because of the error message shown below whenever I run a proc print statement:
“ERROR: Format $RACEFMT not found or couldn't be loaded for variable RACE.
ERROR: Format $SEXFMT not found or couldn't be loaded for variable SEX.
ERROR: Format $CDTYPEI not found or couldn't be loaded for variable CDTYPE.
ERROR: Format $PD96DET not found or couldn't be loaded for variable PDIS.
ERROR: Format $YNUFMT not found or couldn't be loaded for variable HISPANIC.
ERROR: Format $RXSTOP not found or couldn't be loaded for variable RXSTOP.
NOTE: The SAS System stopped processing this step because of errors".
I applied the following libname codes before the proc print statement:
LIBNAME CORE 'C:\Users\CORE';
LIBNAME LIBRARY 'C:\Users\CORE';
options fmtsearch= (formats64 CORE LIBRARY);
The proc print statement was:
proc print data=CORE.patients;
run;
I was hoping someone could help me troubleshoot the coding steps such that the problem with the Format and how it can be applied to the dataset will be resolved. Thanking you in advance for your help.
Best,
Ayo
You can print and work with the data set if you set: Options nofmterr;
One of the SAS system settings treats missing formats as an error or not. If your current session has the Options fmterr; set then that will prevent much code from working on datasets with formats assigned.
Your Fmtsearch should reference the Library and the catalog they are in a catalog names anything other than Formats.
So maybe you need something like:
options fmtsearch= (Core.formats64 );
You said "folder" and neither of your library definitions seems to include a folder named Formats64. Some perhaps you need to change the library definition. Does the "folder" named formats64 have a file with the extension SAS7BCAT? That would be a catalog holding the formats. Which may not work if created under a different version of SAS.
In which form did you receive the formats? As code, CNTLIN datasets or as catalog(s)?
Be aware that SAS catalogs are not a good way to keep/transport formats. They depend on SAS version, hardware architecture and operating system; if any of these changes, the catalogs may not (and usually do not) work any longer.
It is much better to store formats as CNTLIN datasets for PROC FORMAT, or as PROC FORMAT code.
You can print and work with the data set if you set: Options nofmterr;
One of the SAS system settings treats missing formats as an error or not. If your current session has the Options fmterr; set then that will prevent much code from working on datasets with formats assigned.
Your Fmtsearch should reference the Library and the catalog they are in a catalog names anything other than Formats.
So maybe you need something like:
options fmtsearch= (Core.formats64 );
You said "folder" and neither of your library definitions seems to include a folder named Formats64. Some perhaps you need to change the library definition. Does the "folder" named formats64 have a file with the extension SAS7BCAT? That would be a catalog holding the formats. Which may not work if created under a different version of SAS.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.