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

I have a problem that I have worked on for days now.

I Have a big SAS dataset that has a corresponding formatfolder. I have tried to run the dataset without merging it with the formatfolder first. But I keep on getting errors or notes that the format was not found, which is prohibiting the results in showing. I have even tried to start with the options=nofmterr statement but without success.

 

I think I need to merge the format folder with my dataset to make it work, but I have no idea how to.

 

I can not make a merge statement as there are no common variables. The only common parameter is that the label in dataset corresponds with the variable Label_name in the formatfolder.

 

I have tried to make a fmtlibname statement, but could not make it work.

 

What do I do?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

What do you mean by a "format folder"? 

SAS stores formats in catalogs.  The default name for the catalog is FORMATS, but you can use any valid member name for the name of the catalog that contains the formats.  So if you have a file named formats.sas7bcat then that is a format catalog.  To reference that catalog make a libref that points to the directory (aka "folder") where the file exists. 

libname myfmts 'my format folder';
options insert=(fmtsearch=(myfmts.formats));

If instead you have some SAS code that runs PROC FORMAT and creates the formats then just run the code.

%include "my format folder/formats.sas";

If mean something else then explain in more detail what it is that you have.

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

What do you mean by a "format folder"? 

SAS stores formats in catalogs.  The default name for the catalog is FORMATS, but you can use any valid member name for the name of the catalog that contains the formats.  So if you have a file named formats.sas7bcat then that is a format catalog.  To reference that catalog make a libref that points to the directory (aka "folder") where the file exists. 

libname myfmts 'my format folder';
options insert=(fmtsearch=(myfmts.formats));

If instead you have some SAS code that runs PROC FORMAT and creates the formats then just run the code.

%include "my format folder/formats.sas";

If mean something else then explain in more detail what it is that you have.

Kurt_Bremser
Super User

I suspect that you have datasets that can be used as CNTLIN datasets for PROC FORMAT. Such datasets would contain columns named fmtname, start, label, type.

ballardw
Super User

@Jannie_D wrote:

I have a problem that I have worked on for days now.

I Have a big SAS dataset that has a corresponding formatfolder. I have tried to run the dataset without merging it with the formatfolder first. But I keep on getting errors or notes that the format was not found, which is prohibiting the results in showing. I have even tried to start with the options=nofmterr statement but without success.

 

I think I need to merge the format folder with my dataset to make it work, but I have no idea how to.

 

I can not make a merge statement as there are no common variables. The only common parameter is that the label in dataset corresponds with the variable Label_name in the formatfolder.

 

I have tried to make a fmtlibname statement, but could not make it work.

 

What do I do?


 Please run this code:

proc options option=fmtsearch;
run;

Your log will show something like:

 FMTSEARCH=(WORK LIBRARY)
                   Specifies the order in which format catalogs
                   are searched.

Copy the result similar to above from your Log and paste into a code box opened on the forum with the </>.

Then show use the library name and details about your "format folder".

 

If you do not have 1) the library appear in the FMTSEARCH path as shown in the code then you need to add it as @Tom shows.

FMTSEARCH is where SAS looks for Formats. If your formats are not in one of the places listed it cannot find them.

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 917 views
  • 0 likes
  • 4 in conversation