Desktop productivity for business analysts and programmers

Importing excel file to SAS

Reply
Frequent Contributor
Posts: 77

Importing excel file to SAS

Hello Everyone,

 

New to SAS. After importing my excel file to SAS, how do I save the file permanently into a sas dataset? Everytime I save the project and close out, I have to reimport the dataset again. Thanks for your help!

 

Bryan

Trusted Advisor
Posts: 1,197

Re: Importing excel file to SAS

Hello @byeh2017,

 

if you have your excel file in SAS in a sas dataset, you can use a library and a data step to save it from the work location to the library (permanent location).

 

Something as the following code should work:

 

libname myfolder BASE "C:\my_folder";

data myfolder.myexcel;
set work.myexcel;
run;
Frequent Contributor
Posts: 77

Re: Importing excel file to SAS

Is the base where the library folder name should be? How do I know the location of my library folder? At this point my temporary dataset from excel on SAS is called "work.'inpatient data basefile'n"

 

Thank you

Trusted Advisor
Posts: 1,197

Re: Importing excel file to SAS

Hello @byeh2017,

 

you can select the location you prefer as permanent location. I am sure you have your home/user folder where you store all your code and other archives.

 

Also, a recommendation: I highly recommend you to change the final name of your sas datasets from "work.'inpatient data basefile'n" to something more simple and readable as: "myfolder.InpatientData" or similar.

Ask a Question
Discussion stats
  • 3 replies
  • 125 views
  • 0 likes
  • 2 in conversation