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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 9577 views
  • 0 likes
  • 3 in conversation