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

In a previous programming session, I wrote the following format:

 

proc format;
	value class
	1 = 'No tests'
	2 = '1 to 3 tests'
	3 = '4 or more tests';
run;

Two questions:

1) How did this format get attached to the 8. general format? Now, when I create other variables and designate them as 8. format, I get the following error message:

ERROR: The format CLASS was not found or could not be loaded

2) How can I search for the CLASS format I created to delete it? It doesn't appear in my permanent or work libraries?

3) How can I change 8. back to a general numeric format?

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
yabwon
Onyx | Level 15

1) use "nofmnterr" option: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lesysoptsref/p1djbl02hfnoe3n0zh2i3uu2aqrf.htm

2) if you dont have definition of a format you can:

a) overwrite it by "your defaut" format:

proc format;
	value class
	other=[best32.];
run;

b) or drop the format by proc datasets:

proc format;
	value class
	other="My format :-)";
run;

data test;
  a=1;
  format a class.;
run;
proc contents data = test;
run;

proc datasets lib = work;
  modify test;
    format a;
  run;
quit;

proc contents data = test;
run;

3) try like this:

proc datasets lib = work;
  modify test;
    format a best32.;
  run;
quit;

 

Bart

 

 

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



View solution in original post

3 REPLIES 3
yabwon
Onyx | Level 15

1) use "nofmnterr" option: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lesysoptsref/p1djbl02hfnoe3n0zh2i3uu2aqrf.htm

2) if you dont have definition of a format you can:

a) overwrite it by "your defaut" format:

proc format;
	value class
	other=[best32.];
run;

b) or drop the format by proc datasets:

proc format;
	value class
	other="My format :-)";
run;

data test;
  a=1;
  format a class.;
run;
proc contents data = test;
run;

proc datasets lib = work;
  modify test;
    format a;
  run;
quit;

proc contents data = test;
run;

3) try like this:

proc datasets lib = work;
  modify test;
    format a best32.;
  run;
quit;

 

Bart

 

 

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



EmilyAV
Calcite | Level 5

Great, thank you!

ballardw
Super User

@EmilyAV wrote:

In a previous programming session, I wrote the following format:

 

proc format;
	value class
	1 = 'No tests'
	2 = '1 to 3 tests'
	3 = '4 or more tests';
run;

Two questions:

1) How did this format get attached to the 8. general format? Now, when I create other variables and designate them as 8. format, I get the following error message:

ERROR: The format CLASS was not found or could not be loaded

2) How can I search for the CLASS format I created to delete it? It doesn't appear in my permanent or work libraries?

3) How can I change 8. back to a general numeric format?

 

Thank you.


The error does not have anything to do with attempting to create other variables. Pretty much any use of data set with a format not currently defined with throw the error when option FMTERR is set. With NOFMTERR set you will often get something similar to

Format XXXXX was not found or could not be loaded.

where XXXXX is the name of the format in question. The default format for the variable type would then be used.

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
  • 687 views
  • 1 like
  • 3 in conversation