Hi,
while running this program.
proc import datafile="Z:\Users\Ramanathan\test1.xls" out=ab dbms=excel replace;
sheet="xdm";
getnames=yes;
datarow=4;
run;
I'm getting error in datarow statement. I don't know why? can anyone explain me.
Thanks
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.
hi reza,
I have sas 9.2.
hi,
how to read multiple sheet from a excel file with xsl engine. And how to restrict the number of obs in the dataset while importing from an excel file.
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?
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:
data want;
set have (obs=...);
run;
To read multiple sheets, use the sheetname="..." option in proc import, or save each sheet to a separate CSV, or use libname excel.
Try startrow=4 or multiple range option: range='A1:D10'; range='A10:D20';
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.