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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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