BookmarkSubscribeRSS Feed
kranthikumari
Calcite | Level 5

Hi All,

i have exported the cars from sashelp. for my sas programming practice, again i am trying to import with rename option, but the data set variable names are not changing

 

proc import datafile="d:\IQ\cars_1.xls"

out=ds3 (rename=(MSRP=msrp_1))
dbms=excel replace;
run; 

 

5 REPLIES 5
slathiya444
Calcite | Level 5
I think the problem is in DBMS field.
Kalind_Patel
Lapis Lazuli | Level 10

Have you checked the column properties?
You might be seeing MSRP as label but actually it was changed to msrp_1.

 

For me this code worked:

proc export data=sashelp.cars
outfile="d:\cars_1.xls" dbms=xlsx replace;
run;

proc import datafile="d:\cars_1.xls"
out=ds3 (rename=(MSRP=msrp_1))
dbms=xlsx replace;
run; 
Kalind_Patel
Lapis Lazuli | Level 10

You can see column properties by double clicking on column:

 

2020-01-09_15-37-46.jpg

 

 

PaigeMiller
Diamond | Level 26

@kranthikumari wrote:

Hi All,

i have exported the cars from sashelp.


Show us the code that did this export.

 

Also, since we are trying to help you, please help us by going back and edit your original post and provide a meaningful title. A title of "SAS" is not meaningful, every question is about SAS.

--
Paige Miller
Kurt_Bremser
Super User

If "sas" is all you can come up with as a descriptive subject line, your future with SAS looks very bleak. Working with complex software requires effort on your part.

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!

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
  • 5 replies
  • 867 views
  • 2 likes
  • 5 in conversation