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

Perhaps this is a minor complaint, but I often find myself changing the names of columns after I set a summary method.  Is there a way to prevent the column name from changing from COLUMN_NAME to SUM_of_COLUMN_NAME?

 

While I believe I have thouroughly searched through the setting, I hold on to hope that I have overlooked it.

 

Thanks,

Ryan

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Query builder is straight forward, when summarizing you have a field that says Column Name that you can type whatever you want into it, as long as it's a valid name. I don't think there's a default way to specify it to stay the same variable.

 

delete column name.JPG

 

The code override is relatively straightforward, as long as you're only calculating one statistic (ie mean/sum) it automatically saves with the same name. You do have to list the variables but you can use variable shortcuts.

 

proc means data=sashelp.class noprint;
var age weight height;
output out=want mean=;
run;

View solution in original post

4 REPLIES 4
Reeza
Super User

Which Task exactly are you using?

 

I'm not sure there's a point and click mechanism, but I know for certain you can override this with code.  

 

You'll find EG will get you there 90%, the remaining 10% is code 🙂

RyanK
Obsidian | Level 7
This is in a simple query builder, but I would happily use another task if it would avoid the issue. I absolutely can override it with code, but was hoping to avoid that. In this case, I am aggregating 27 variables and would prefer to not type it out.
Reeza
Super User

Query builder is straight forward, when summarizing you have a field that says Column Name that you can type whatever you want into it, as long as it's a valid name. I don't think there's a default way to specify it to stay the same variable.

 

delete column name.JPG

 

The code override is relatively straightforward, as long as you're only calculating one statistic (ie mean/sum) it automatically saves with the same name. You do have to list the variables but you can use variable shortcuts.

 

proc means data=sashelp.class noprint;
var age weight height;
output out=want mean=;
run;
RyanK
Obsidian | Level 7

Fantastic, that takes 50 lines of PROC SQL down to 5 lines of PROC MEANS.  

 

I was not aware of variable lists, they work perfectly in this scenario.

 

Thanks for your help.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1591 views
  • 0 likes
  • 2 in conversation