BookmarkSubscribeRSS Feed
stat11
Calcite | Level 5
Hello,

Is it possible to input multiple ranges when using PROC IMPORT on an Excel file?

PROC IMPORT DATAFILE = "C:\abcSept08.xls"
OUT = abc_Sep08
DBMS = EXCEL2000 REPLACE;
RANGE = "XYZ$B48:Q51";
GETNAMES = NO;
RUN;

Above is my current code. If I also want to bring in cells B121:Q140 and B210:Q234, is it possible to do it all in one step?

Thanks for your help.
1 REPLY 1
LinusH
Tourmaline | Level 20
It seems that you cannot do that.
So your choices are:
- run multiple imports, and then append the different result sets
- read the whole Excel-sheet and post process it
- use the LIBNAME excel engine together with named ranges, each named range will appear as separate SAS tables, which you could read in one operation (data-set a b c...;).

/Linus
Data never sleeps

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!

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