DATA Step, Macro, Functions and more

Format $[name] was not found or could not be loaded

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

Format $[name] was not found or could not be loaded

I created and user defined format but when I run data step to apply format the log reads Format $disf was not found or could not be loaded. I am using SAS University Edition. Engine V9. Below is the full code. Any ideas will be appreciated.

 

 

libname abc "/folders/myfolders/xyz";

 

Proc import datafile="/folders/myfolders/xyz/document.xlsx"

out=doc1

dbms=xlsx;

run;

 

proc format;

value disf 0='No' 1='Yes';

run;

 

data doc2; set doc1;

format diseased disf.;

run;

 


Accepted Solutions
Solution
2 weeks ago
PROC Star
Posts: 1,592

Re: Format $[name] was not found or could not be loaded

[ Edited ]

Ok so add a $ to format name and try again

proc format;

value $disf 0='No' 1='Yes';

run;

 

View solution in original post


All Replies
PROC Star
Posts: 1,592

Re: Format $[name] was not found or could not be loaded

You need to examine your dataset doc1 thoroughly and properly. Your code works fine for my example:

 

proc format;

value disf 0='No' 1='Yes';

run;

 

data w;
do i=1 to 10;
 do j=0 to 1;
output;
end;
end;
format j disf.;
drop i;
run;

Respected Advisor
Posts: 2,833

Re: Format $[name] was not found or could not be loaded

Is the variable DISEASED numeric or character?

--
Paige Miller
Occasional Contributor
Posts: 6

Re: Format $[name] was not found or could not be loaded

Posted in reply to PaigeMiller

It's a character variable. 

Solution
2 weeks ago
PROC Star
Posts: 1,592

Re: Format $[name] was not found or could not be loaded

[ Edited ]

Ok so add a $ to format name and try again

proc format;

value $disf 0='No' 1='Yes';

run;

 

Super User
Posts: 13,338

Re: Format $[name] was not found or could not be loaded

Posted in reply to novinosrin

@novinosrin wrote:

Ok so add a $ to format name and try again

proc format;

value $disf 0='No' 1='Yes';

run;

 


AND use the new format:

data doc2; set doc1;

format diseased $disf.;

run;

Occasional Contributor
Posts: 6

Re: Format $[name] was not found or could not be loaded

☑ This topic is solved.

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

Discussion stats
  • 6 replies
  • 116 views
  • 0 likes
  • 4 in conversation