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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 1502 views
  • 0 likes
  • 2 in conversation