BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have created the table Mytable in a data step and want to save it to the directory C:\Mydir. I want to do the saving with code.

How can that be done?
Special procedure(s) or even possible in the data step itself?
2 REPLIES 2
abdullala
Calcite | Level 5
dont quite understand what you want. can you just create a library for this folder c:\mydir and create a dataset in that library?

libname save 'c:\mydir';
data save.mytable;
set mytable;
run;

is this what you wanted?
DanielSantos
Barite | Level 11
Tables are physically stored into a single file in the system (usually with a .sas7bdat extension).

So, if you're creating MyTable to dataset code, redirecting the output table to the desired libname (directory) should be enough and the simplest way.

You could still use the COPY procedure to copy the dataset from one libname to another.

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000085782.htm

Cheers from Portugal.

Daniel Santos @ www.cgd.pt

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 9330 views
  • 0 likes
  • 3 in conversation