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

Is there a way to prevent my variables names from being truncated to 20 characters in the output?

 

data have;
 set sashelp.bweight;
 rename momwtgain = dont_truncate_this_var;
run;


proc glmselect data = have;
 model weight = momage cigsperday dont_truncate_this_var;
run; quit;

My actual GLMSELECT statement uses stepwise selection and a CLASS statement, so I'd prefer to stick with GLMSELECT if possible.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
Try option NAMELEN=
proc glmselect data = sashelp.class namelen=32;
model weight = age height;
run; quit;

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

What output? Are you saying that the print-out generated by PROC GLMSELECT is showing only the first 20 characters of that variable name? What part of the print-out?

Or are you generating an output dataset from that PROC?  I don't see where you are specifying any output datasets in your code.

bkq32
Quartz | Level 8
Sorry, yes the first option. I'm referring to the print-out from PROC GLMSELECT. In the SelectionSummary and ParameterEstimates results, the variable "dont_truncate_this_var" has been shortened to "dont_truncate_this_v". The log says:

NOTE: Effect labels on plots have been truncated at 20 characters.
Ksharp
Super User
Try option NAMELEN=
proc glmselect data = sashelp.class namelen=32;
model weight = age height;
run; quit;
bkq32
Quartz | Level 8
This worked great, thank you!

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
  • 4 replies
  • 1170 views
  • 0 likes
  • 3 in conversation