I have a question. I have defined some sas formats for different variables in a data set like for colon, stomach , digestive organs
eg. value liver 100=Basalcarciinoma, 200= Sarcoma etc
value stomach= .......................................
now I want to call all these format values at the same time in a data step in another program. Is there any way to do that?
I used
%include to bring the formats in the other program
normally one can then add to the data step eg.
data changedformats;
set dataiwanttochange;
if bodypart =liver then part=liver;
fomat part liver.;
run;
my question is how to I call all the format values at once like format liver. stomach. mouth. etc
Is there anyway to that?
So you have used PROC FORMAT somewhere in your program to create formats.
Later in the program, you want to use the formats. No %include is needed in this case.
my question is how to I call all the format values at once like format liver. stomach. mouth. etc
Is there anyway to that?
format livervariable liver. stomachvariable stomach. mouthvariable mouth. /* more variables and formats can be listed here if they exist */;
Okay, let me try that. Thanks a lot
I think this is what you are asking about ...
On the PROC FORMAT statement, the LIBRARY= option lets you permanently save the formats you create.
You can make those formats available by adding (in subsequent programs) the global option:
options fmtsearch= ..... ;
You will need to do a little research on both topics (saving, and retrieving).
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.