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

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

5 REPLIES 5
AyoSho
Obsidian | Level 7
Thanks for reaching out Kurt. I received the formats as catalogs and I have been able to apply options fmtsearch to solve the error issues, after making some changes.
Kurt_Bremser
Super User

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.

ballardw
Super User

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.

AyoSho
Obsidian | Level 7
Thank you!. Worked without errors. Much appreciated.

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
  • 5 replies
  • 1155 views
  • 3 likes
  • 3 in conversation