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.
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.
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.
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.
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!
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.