Odd format error present when not formatting anything

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Odd format error present when not formatting anything

[ Edited ]

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.


Accepted Solutions
Solution
‎08-16-2016 09:02 AM
Super User
Posts: 7,433

Re: Odd format error present when not formatting anything

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
‎08-16-2016 09:02 AM
Super User
Posts: 7,433

Re: Odd format error present when not formatting anything

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Super User
Posts: 7,720

Re: Odd format error present when not formatting anything

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.

New Contributor
Posts: 4

Re: Odd format error present when not formatting anything

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!

Super User
Posts: 11,134

Re: Odd format error present when not formatting anything

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 276 views
  • 3 likes
  • 4 in conversation