BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jmpalumbNCSU
Calcite | Level 5

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?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

1 REPLY 1
ballardw
Super User

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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 559 views
  • 0 likes
  • 2 in conversation