BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tparvaiz
Obsidian | Level 7

How to save SAS Dataset in a c drive and acess it.

 

A) save dataset

here is something I've used to save excel file. how will it work for sas dataset

 

%let YYYYMM = 201703;

 

data _null_;
file cmds;
put "[save.as(%bquote("C:\Program Files\output\DataSet &YYYYMM..xlsx"))]";
put '[CLOSE()]';
run;

 

B) import dataset

can you please advise how to import dataset in a sas program

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

A SAS dataset is stored in a library; a library definition (libname statement) connects a logical SAS library name with a physical path to an existing directory.

You do not "import" a SAS dataset into SAS. Datasets are read with proc sql ("from") or with the set or merge statements in a data step, or by naming them in the data= option in a procedure statement.

 

There are several ways to move SAS data to other applications; which one should be used has to be determined according to the external application and what exactly (just data, or whole reports) needs to be exported.

View solution in original post

1 REPLY 1
Kurt_Bremser
Super User

A SAS dataset is stored in a library; a library definition (libname statement) connects a logical SAS library name with a physical path to an existing directory.

You do not "import" a SAS dataset into SAS. Datasets are read with proc sql ("from") or with the set or merge statements in a data step, or by naming them in the data= option in a procedure statement.

 

There are several ways to move SAS data to other applications; which one should be used has to be determined according to the external application and what exactly (just data, or whole reports) needs to be exported.

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1723 views
  • 0 likes
  • 2 in conversation