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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2753 views
  • 0 likes
  • 3 in conversation