My start row starting row 9 and names are in row 8. using the code below I got :
1794 namerow=8;
-------
180
1795 datarow=9;
-------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
proc import out= work.spadfw
datafile= "D:\Projects\Myfile.xlsx"
dbms=excel replace;
*range="sheet1$";
getnames=yes;
namerow=8;
datarow=9;
*mixed=no;
*scantext=yes;
*usedate=yes;
*scantime=yes;
RUN;
Any hints? Thanks in advance.
I'm pretty sure those options are only valid for XLS-type files. For XLSX use the RANGE option and GETNAMES to trigger reading column names from the row just above the range:
You could also try STARTROW= instead of DATAROW. It might still work.
DBMS=Excel + Datarow does not work for me either. DBMS=XLSX + Datarow should work.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.