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

hello i want to import multiple xls sheets to sas . please guide how to do it ?

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19
Google will reveal how to do this. Using libname-statement and proc copy is one way. Writing a proc import for each sheet is another way. Best thing you could do: export all sheets to CSV and use a data-step to read each. This is imho the only.way to get a reliable importing-process.

View solution in original post

2 REPLIES 2
andreas_lds
Jade | Level 19
Google will reveal how to do this. Using libname-statement and proc copy is one way. Writing a proc import for each sheet is another way. Best thing you could do: export all sheets to CSV and use a data-step to read each. This is imho the only.way to get a reliable importing-process.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I strongly advise you, if you have to use Excel at all, to move that data into a .xlsx file.  .xls is the very old binary file format MS used to use back in 2000 and before.  It shouldn't be used nowadays.  Technology has moved on a lot since then, and assuming your SAS version is 9.3 or later you can simplify your process if you xlsx to:

libname tmp xlsx "c:/path/to/file/yourfile.xlsx";

proc copy in=tmp out=work;
run;

libname tmp clear;

You can see the engine in action:
https://blogs.sas.com/content/sasdummy/2015/05/20/using-libname-xlsx-to-read-and-write-excel-files/

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 940 views
  • 3 likes
  • 3 in conversation