Hey all, I'm a new-ish user to SAS (Enterprise Guide is my environment and I import code from notepad). I'm cleaning up some data output of patient records from my hospital system (RedCap, for what it's worth) and in my proc means, I have a fairly long width column that corresponds to a survey question. Some of them are long sentence fragments and as I'm cleaning data (missing, malformed, entered wrong, etc) and it would make my life a but easier if I could make the character limit on my Label column short enough so that the error codes and variable names are both visible without side scrolling. Do I need to add label and format statements to my code or is there an easier way to transcribe my data?
You can temporarily change the default label for a single run of a procedure by using a label statement in the procedure.
Suppose you have a variable named VarX with a label like "This variable has a moderately long description that I don't want to show the entire text". Then you could use:
Proc means data=have;
var Varx;
label Varx ="Shorter label for VarX";
run;
You might also try temporarily setting the System option to NOLABEL to suppress use of labels temporarily. Then only the variable names would be shown in the output.
options NOLABEL;
Proc means data=have;
var Varx;
run;
options LABEL;
But if you many somewhat obtuse variable names this may not be viable.
You can temporarily change the default label for a single run of a procedure by using a label statement in the procedure.
Suppose you have a variable named VarX with a label like "This variable has a moderately long description that I don't want to show the entire text". Then you could use:
Proc means data=have;
var Varx;
label Varx ="Shorter label for VarX";
run;
You might also try temporarily setting the System option to NOLABEL to suppress use of labels temporarily. Then only the variable names would be shown in the output.
options NOLABEL;
Proc means data=have;
var Varx;
run;
options LABEL;
But if you many somewhat obtuse variable names this may not be viable.
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.