DATA Step, Macro, Functions and more

sas 9.4 SAS DATA SET Saving to Windows Desktop

Reply
New Contributor miz
New Contributor
Posts: 2

sas 9.4 SAS DATA SET Saving to Windows Desktop

Hello. i have merged three data sets, each of which were imported from a windows desktop C:location using the INFILE statement. How do i export this new (merged) single data set back to the desktop? Thank you!

Super User
Posts: 17,819

Re: sas 9.4 SAS DATA SET Saving to Windows Desktop

1. Assign a library to the location you'd like the data set to be stored. 

2. Use PROC datasets to move the data set. Or another data step. 

 

Libname outloc '/folders/myfolders/samples/';

 

proc datasets library=work;

copy in=work out=outloc;

select dataset_save;

run;quit;

New Contributor miz
New Contributor
Posts: 2

Re: sas 9.4 SAS DATA SET Saving to Windows Desktop

Hello Grand Advisor Reeza.



Would you please provide me further insight for the first step:



1. Assign a library to the location you'd like the data set to be stored.

Is this step to be completed in Windows? If yes, then how?



Still learning, miz


SAS Super FREQ
Posts: 8,743

Re: sas 9.4 SAS DATA SET Saving to Windows Desktop

Hi:
LIBNAME myperm 'c:\temp\sasdata';

data myperm.class;
set sashelp.class;
run;

This will write a SAS dataset to the folder location: C:\temp\sasdata\class.sas7bdat (which is the Windows file extension for a SAS dataset). Do note that c:\temp\sasdata folder must be already created and you will need to have write access to that folder for the program to work.

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 160 views
  • 0 likes
  • 3 in conversation