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