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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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