11-04-2016 12:49 AM
while running this program.
proc import datafile="Z:\Users\Ramanathan\test1.xls" out=ab dbms=excel replace;
I'm getting error in datarow statement. I don't know why? can anyone explain me.
11-04-2016 01:47 AM
Is datarow supported for DBMS Excel? It doesn't look like it.
What version of SAS do you have?
It's sometimes hard to navigate the documentation for PROC Import.
11-04-2016 02:20 AM
Try a libname method with proc copy or datasets.
Assign a libname and then use PROC datasets with a copy statement to copy sheets to library.
How do you want to restrict observations? What's your logic?
11-04-2016 04:24 AM
What is the question here exactly? To import from Excel your options are proc import, libname excel, saving the file to a proper formats such as CSV and datastep import - all of which there are thousands of examples on here. To limit the number of observations, just read the file, then do:
set have (obs=...);
To read multiple sheets, use the sheetname="..." option in proc import, or save each sheet to a separate CSV, or use libname excel.