08-05-2017 12:31 PM
08-05-2017 02:57 PM
If you have SAS/Access to PC files you can try LIBNAME EXCEL Engine.
If your trying to append all the data in different sheets you assign the excel file as a library and read the individual sheets.
NOTE: If you see the datasets in the Excel library with "$" trailing then the dataset has to be referenced as FILE.'sheet1$'n
Libname file EXCEL "<FilePath>";
PROC SQL ;
into :ranges separated by ' '
where libname = 'FILE'
LIBNAME File clear;
Hope this helps,
08-05-2017 04:52 PM
Well, @SuryaKiran, that's brilliant, I like it ... but the original request was very stubborn and clear ... no macros, no PROC SQL (and sounds very much like a homework assignment)
08-05-2017 07:12 PM
The SAS/ACCESS Interface to PC Files engine that you use may depend on your version of SAS and the type of Excel file that you need to import.
Here is sample code to import an XLSX file using SAS 9.4 M4:
libname xl xlsx 'C:\temp\MyFile.xlsx' access=read; options validvarname=any validmemname=extend; proc datasets nolist; copy in=xl out=work; run; quit;