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

I have a simple dataset with two variable called "cc" and "ss", and I want to rename them using a datastep like the following:

 

data new_data;

     set old_data;

     rename cc=vcc ss=vss;

run;

 

After the datastep, I run a proc contents to see that the variable names are change correctly - which they are. But if I then afterwards opens the actual new dataset, where the new variable name should be assigned, then I can't see the newly assigned names - like nothing have happend at all.

 

Does anyone know, why this happens and how I can fix it? 

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

HI @Biniie  One possibility is that it may display labels if permanent labels are associated with variable names. Did you check that in proc contents by any chance as well?

 

Please post the proc contents output if you can. Thank you!

 

Other possibility though may sound silly, you might be opening the old_data

View solution in original post

3 REPLIES 3
novinosrin
Tourmaline | Level 20

HI @Biniie  One possibility is that it may display labels if permanent labels are associated with variable names. Did you check that in proc contents by any chance as well?

 

Please post the proc contents output if you can. Thank you!

 

Other possibility though may sound silly, you might be opening the old_data

Biniie
Fluorite | Level 6

Hi @novinosrin

 

Of course!! It did show the variabels labels (which was identical with the old-names") instead of the variables names. 

 

Thanks for solving my mysterie 🙂  

 

novinosrin
Tourmaline | Level 20

Glad, that was the problem. Have fun! 🙂

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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