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

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

1. Assign a library to the location you'd like the data set to be stored. To assign a library, use the LIBNAME statement to map a libname alias to the desired path on your local PC.

 

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;

/* Or this, to copy WORK data to a permanent folder */
data outloc.dataset_save;
 set work.dataset_save;
run;

 

View solution in original post

3 REPLIES 3
Reeza
Super User

1. Assign a library to the location you'd like the data set to be stored. To assign a library, use the LIBNAME statement to map a libname alias to the desired path on your local PC.

 

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;

/* Or this, to copy WORK data to a permanent folder */
data outloc.dataset_save;
 set work.dataset_save;
run;

 

miz
Calcite | Level 5 miz
Calcite | Level 5
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


Cynthia_sas
SAS Super FREQ
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

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
  • 3 replies
  • 12113 views
  • 0 likes
  • 3 in conversation