5
votes

Is is possible to save SAS data set (sas7bdat) to a local folder on server? For example c:\Work folder. I know only proc export to csv. Thank you.

3
Are your working with a local (windows) Version of SAS or serverside, EG etc.?Jetzler
By "local" do you mean local to the SAS server or local to you? For SAS to write directly to a directory it will need access to that directory while it is running. If you are using Enterprise Guide there may be some tricks to download a file from the server to your local PC that you can use to download the file that is the SAS dataset.Tom
@Tom Hi Tom. I am using EG connected to server. The destination folder is in server too. I need just export my data set (with sas7bdat format) to folder on server. Is it possible? I now the way to do it by proc export csv but I do not need that format.Donald William Glossfield
The answer by Reeza is what you want.Tom

3 Answers

6
votes

Yes, this is what libraries are in SAS. They're essentially folders to store SAS datasets. First create a library reference to the location and then save the dataset to the location.

Libname out '/folders/myfolders/output/';

data out.data_save;
    Set data_to_save;
 Run;
0
votes

Depends on how you're connecting to the server and whether you have SAS installled in local machine or not.

If you're using EG you can export the data as csv for example. If what you need is the data as SAS data set then a combination of rsubmit and proc download should do fine.

Here in an example for when you have SAS installed locally:

libname w  "/windows_directory"; 

signon server.port user='your_user' password="your_pwd" ;
rsubmit ;
libname r  "/remote_folder"; 
* Executed in UNIX;

proc download data= r.inServer out= w.inServer; run;
endrsubmit; 
0
votes

Check this out, https://stackoverflow.com/a/67914980/8311083.

You can export to sas7bdat as a file to the server.