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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 972 views
  • 3 likes
  • 3 in conversation