BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MeganE
Pyrite | Level 9

Hi,

 

I need to move a dataset from one libname to another, but i don't want to use a data/set statement because they can be large and i have no reason to read the observations.

 

But i want to rename the dataset in the new location.  I was using proc copy until the rename issue came up, and i can't find anything online that shows how to do that.

 

proc copy in=kcurr out=knew;
    select k4_29jun16;
run;

 

I want to rename it to just K4 in the knew location.

 

Thanks,

Megan

1 ACCEPTED SOLUTION

Accepted Solutions
MeganE
Pyrite | Level 9

Well, i have this working.  Anyone know how to get it all done in one step though instead of two?

 

proc copy in=kcurr out=knew;
    select &k4.;
run;
proc datasets library=knew;
    change &k4.=k4;
run;
quit;

View solution in original post

4 REPLIES 4
MeganE
Pyrite | Level 9

Well, i have this working.  Anyone know how to get it all done in one step though instead of two?

 

proc copy in=kcurr out=knew;
    select &k4.;
run;
proc datasets library=knew;
    change &k4.=k4;
run;
quit;

Reeza
Super User

Ome suggestion would be that you can use proc datasets to copy as well as rename. 

 

Another, which I would test for speed, is to use PROC Append, it uses a block copy method as well and doesn't require the base data to be pre-existing. Not sure if it's as fast as proc copy though. 

Ksharp
Super User

you could try. But I don't know if it could work:

 


proc datasets library=kcurr ;

   change &k4.=k4;

run;

   copy out=knew;
run;
quit;

andreas_lds
Jade | Level 19

Use proc datasets and "change"-statement to rename the dataset after/before it is copied. Unfortunately proc copy has no rename option.

 

Well, i am to slow today 😐

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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