BookmarkSubscribeRSS Feed
FatCaptain
Fluorite | Level 6
My server is being rebooted shortly.

I'm trying to dump all of the data sets from the server work directory onto my pc so I can upload them again when the servers back online.

The code I'm trying to run is as follows;



RSUBMIT ;

LIBNAME drive 'C:\temp\sessiondump';

PROC COPY IN=SASCATCA OUT=drive ;
SELECT _ALL_ ;
RUN ;

ENDRSUBMIT ;



This code works if I individually list all of the datasets in the SELECT statement.

As the session has a few hundered data sets, I'm wanting to specify the entire contents using a single reference.

My first thought was _ALL_ but this isn't working.

Any ideas?

Any help with this would be appreciated.

Cheers,

Fat Captain.
5 REPLIES 5
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello,

It is possible to create a list of tables from the work library:
[pre]
proc SQL noprint;
select memname into :tablst separated by " "
from sashelp.vmember
where libname="WORK"
;quit;
[/pre]
and then use it in proc COPY:
[pre]
select &tablst;
[/pre]

SPR
ArtC
Rhodochrosite | Level 12
If you do not use the SELECT statement the default is everything of the given memtype.
Ksharp
Super User
Hi. Art Carpenter is right. Remember SAS syntax is very flexible.
To incorporate Arc's view,you can use modify input or list input ,Such as

[pre]

select a: b: art1-art100;
[/pre]

a: stand for any name of data set which start with alphabetical ' a ';


Ksharp
Florent
Quartz | Level 8
Hi,

You could also create a remote library pointing the WORK library of your server, and then use the datasets procedure in order to move all datasets from that remote library to a local library.

Code is to be executed on the local session (outside of the RSUBMIT/ENDRSUBMIT) and before signing off your connection with the server.

libname rwork server= slibref=work;

proc datasets nolist;
copy in=rwork out=work;
quit;
run;

I hope it helps.

Regards,
Florent
FatCaptain
Fluorite | Level 6
Thank you all for your help.

You've got to love SAS for the flexability it offers.

Cheers,

Fat Captain.

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
  • 975 views
  • 0 likes
  • 5 in conversation