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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.