10-29-2014 05:43 PM
I have been trying to rename the numeric variable 'Price S' to just 'price' but for some reason this variable, along with 'Price US', produce error messages when I run the program. I have been able to change carat ➟car, color➟col, and certification➟cert. Below is the code I am running. If anyone can help it would be greatly appreciated, Thank you.
PROC IMPORT datafile="/home/michaelfletcher/FletcherSAS/WORK/DATA/Diamonds.xls"
DATA diam (rename=(carat=car color=col certification=cert Price_S=price));
PROC CONTENTS data=diam;
10-29-2014 05:52 PM
Please supply the error messages. They are often very helpful in diagnosing problems.
Also if there are any warnings in the log or notes related to encoding.
10-29-2014 05:56 PM
looks nothing wrong with DATA STEPS in your code. below code works fine so do yours too...check variable name for your input dataset in rename step
data b (rename=(carat=car color=col certification=cert Price_s=price));
what is your error message ?
10-29-2014 06:00 PM
No ERROR messages. The proc contents still shows the same variable name and I get this warning message:
WARNING: The variable Price_S in the DROP, KEEP, or RENAME list has never been referenced.
10-29-2014 06:03 PM
This means that the way you typed Price_S doesn't quite match what the name of the variable actually is. Copy it from the proc contents output and paste that into the code. I suspect there may be two or more _ in the actual name together and it just looks like one.