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