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

On my output file, I am changing the name of my columns and building a query using the output dataset file using the new column name.  I see the new column name in the output of the new query I am using.  However, when I run the entire project, the column name change is not permanent.  Can I make it a permanant column name change?

 

I'm changing the column name in the SAS output by first unprotecting the data, then going to properties window and typing in a new name. 

1 ACCEPTED SOLUTION

Accepted Solutions
9 REPLIES 9
aaronh
Quartz | Level 8

Without knowing your procedures, it's difficult to know exactly what you coded. However, if all you want to do is to permanently rename column(s), you can consider either:

 

proc dataset lib=libname;
modify target_dataset;
rename old_var_name = new_var_name;
run;

or in a proc sql step:

proc sql;
select old_var1 as new_var1_name, 
           old_var2 as new_var2_name

from target_dataset;
quit;
Kurt_Bremser
Super User

@req41273 wrote:


I'm changing the column name in the SAS output by first unprotecting the data, then going to properties window and typing in a new name. 


Since this manual action is not recorded anywhere as a task in your project, it won't have any permanent effect.

Depending on how the dataset is created, there are numerous options to set the intended names.

Reeza
Super User
There's a section in query builder itself to rename the new variables or change the name of a calculated variable. Ensure you're doing that within query builder not by manually changing the name in the sheet. That is manual and would need to be done every time.
req41273
Quartz | Level 8

 

where in query builder can this be done.  Can you send me a step by step action on how to do this or a screen print?

req41273
Quartz | Level 8

 

where in query builder can this be done.  Can you send me a step by step action on how to do this or a screen print

req41273
Quartz | Level 8

I've only seen where you can rename if it's a computed column, this column is not a computed column

req41273
Quartz | Level 8

Thanks

 

I found it.

Reeza
Super User
Please post the answer for future users, especially if you're going to mark your comment as the answer. The solved is to help people who are searching find what the correct solution was quickly without reading through all the posts.
Kurt_Bremser
Super User

This


@req41273 wrote:

Thanks

 

I found it.


is NOT a solution. Please post what you have really done, so others can profit from it. You got help here, so help others get help also.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 9 replies
  • 5456 views
  • 2 likes
  • 4 in conversation