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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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