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';
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.