DATA Step, Macro, Functions and more

To save a table.

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?
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;

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.

Cheers from Portugal.

Daniel Santos @
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation