BookmarkSubscribeRSS Feed
fareeham10
Calcite | Level 5
I have a dataset called “Now”,
And I wanted to rename some of the variables within “Now”.
To do this I created a duplicate dataset labeled “UpdatedNow” with the rename function for the different variables and what I want it changed to.
 
However when I run this:
1)upon clicking on the “UpdatedNow” dataset, the message “NOTE: Data set has 0 observations” keeps coming up. What am I doing wrong? 
2) Also, why are the label names not actually converting?
Would greatly appreciate all and any advice. Thank you!86712B91-CBDF-4900-BE58-32B27D810123.jpeg389615BE-29BE-4D11-850F-9AA47110793C.jpeg

  

3 REPLIES 3
japelin
Rhodochrosite | Level 12

Are you sure you are not using the label display?
Try switching to variable name display by doing the following.

japelin_0-1646803939593.png

 

Or try using proc contents to display a list of variable names.

PaigeMiller
Diamond | Level 26

I think @japelin has the right answer, and of course a simple fix.

--
Paige Miller
Ksharp
Super User
data now;
 set sashelp.class;
 label name='XXXX';
run;

data updatednow;
 set now;
rename name=aaaa age=bbbb weight=cccc height=dddd;
attrib _all_ label='';
run;

Remove all these variable's label .

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
  • 3 replies
  • 961 views
  • 3 likes
  • 4 in conversation