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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.