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

I'm getting an error regarding formatting that its puzzling to me.  Here is the code I'm trying to run:

 

proc sort data=M4in.Data1  out=Data1_sorted;
	by idvar cat1 st_date;
run;

%Macro CO_Date;

data TEST;
	set Data1_sorted;
run;

%mend;
%CO_Date;

This code is erroring out, returning an "ERROR: The format PERIOD_FMT was not found or could not be loaded".  There is normally more within the macro, but the error occurrs regardless of what is inside.  It is even happening when its just the simple copying of the previously created sorted dataset.  The sort runs fine, but the macro will not, no matter what is inside of it.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

This means that the format in question is assigned to a column in one of the contributing datasets, but cannot be found in your current format search path (which is set with options ftmsearch).

You either have to expand your fmtsearch so that the catalog containing the format is included, or run the proc format step that creates the format if the format is not stored in a permanent location.

View solution in original post

4 REPLIES 4
Kurt_Bremser
Super User

This means that the format in question is assigned to a column in one of the contributing datasets, but cannot be found in your current format search path (which is set with options ftmsearch).

You either have to expand your fmtsearch so that the catalog containing the format is included, or run the proc format step that creates the format if the format is not stored in a permanent location.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

It sounds to me like the dataset you give has a variable with the format PERIOD_FMT applied to it.  However this format is not defined within your code, nor is the formats catalog in work containing a reference to this format.  You can get round the issue by using:

options nofmterr;

 

before your code.  However that is a workaround, and it may create other problems - for instance that variable will not show any formatted values - so you may not know what they reflect.  I would ask for the format.sas or formats.sas7bcat files which define formats.

secbro
Calcite | Level 5

Thanks for the responses!  This dataset is coming from another programmer so its probable that they are creating this format.  I'll go ahead and check with them to see if I can get this format and add it to my program.

 

Thanks!

ballardw
Super User

In the meantime you can use

options nofmterr;

 

so that missing formats are not an actual error. Then you would be able to see the raw values involved and do some manipulation of the data.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 4 replies
  • 621 views
  • 3 likes
  • 4 in conversation