BookmarkSubscribeRSS Feed

We have many datasets with formats attached that we don't normally use. So we load them with NOFMTERR in effect.

 

However, this clutters up the log file with lots of notes about formats that could not be found. Surely these are not needed? Alternatively, if you don't want to break backwards consistency introduce another option like NOFMTERRNOTE which suppresses these, or add a dataset option to not load the formats for a dataset.

6 Comments
Astounding
PROC Star

Have you tried adding this statement:

 

format _all_;

 

It should turn off all format associations.  If you place it in a DATA step, you could use the output data set for the remainder of the program and not run into this issue.

ballardw
Super User

I think that you really would not want a generic turn of that note as what about the times you are using a different data set and really do want the format but it wasn't available.

 

Or make sure you have the FMTSEARCH path set to find those formats. I have 8 or 9 libraries with formats that are added in my autoexec.sas so I don't have to worry about this for the sets/ libraries I use most frequently.

BruceBrad
Lapis Lazuli | Level 10

RE Astounding: Format _all_ in a data step is no good because I still get the error messages the first time the data step loads the data.

 

RE ballardw: If you want to ensure that formats are attached, shouldn't you use FMTERR? 

Quentin
Super User

I actually like the note, and I like the error more.  But I also like flexibility.  

 

I like the option mergenoby=nowarn|warn|error. In that case nowarn means no note.

 

Maybe an option like:

nofmt=nonote|note|warn|error

Quentin
Super User

@BruceBrad I'm confused what you mean by format _all_ in a data step not working when you first read the data.

 

Below does not throw any messages, regardless of fmterr|nofmterr.

 

options fmterr ;


data want ; set junk.have ; format _all_ ; run ;

 

BruceBrad
Lapis Lazuli | Level 10

Quentin: My apologies. I was assuming that the format error was created as the file was read into the data step. But I've now tested (see code below) - and using a format _all_ after the set statement does suppress the notes. Thanks. This will tidy up my log files.

 

options nofmterr;
proc format;
  value fmt 1="One";
data test;
  var = 1;
  format var fmt.;
proc catalog catalog=work.formats et=format;
  delete fmt;
quit;

* Note created;
data test2;
set test;
run;

* No note created;
data test3;
set test;
format _all_;
run;