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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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