Rename data set option

Reply
Frequent Contributor
Posts: 75

Rename data set option

proc print data =animals (rename=(Class=Type Habitat=Home))

I saw this statement in a book. I am wondering why "Class=Type Habitat=Home"?

Usually old variable name= new variable name, so why is there " =Home"?

Thanks

Trusted Advisor
Posts: 1,321

Re: Rename data set option

Two variables are being renamed...

The variable Class is being renamed to Type and the variable Habitat is being renamed to Home.

Kind Regards,

Michelle

Respected Advisor
Posts: 3,799

Re: Rename data set option

Apple, it is old-name=new-name pears.

Frequent Contributor
Posts: 118

Re: Rename data set option

Rename - Changes the name of the variable

Syntax :

RENAME=(old_name1=new-name1....old_nameN=new_nameN)

Regards

Uma Shanker Saini

N/A
Posts: 1

Re: Rename data set option

Posted in reply to umashankersaini

Is there some declaration that needs to happen before the RENAME.  I get an error message

 

Variable newvar is uninitialized.


Respected Advisor
Posts: 3,799

Re: Rename data set option

Posted in reply to HockeyMomAnalytics

HockeyMomAnalytics wrote:

Is there some declaration that needs to happen before the RENAME.  I get an error message

 

Variable newvar is uninitialized.

You need to put this in context. By including the rest of the data step.  I would start a new thread.

Ask a Question
Discussion stats
  • 5 replies
  • 277 views
  • 0 likes
  • 5 in conversation