DATA Step, Macro, Functions and more

To save a table.

Reply
N/A
Posts: 0

To save a table.

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?
Contributor
Posts: 74

Re: To save a table.

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?
Super Contributor
Posts: 474

Re: To save a table.

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
Ask a Question
Discussion stats
  • 2 replies
  • 115 views
  • 0 likes
  • 3 in conversation