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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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