BookmarkSubscribeRSS Feed
fengyuwuzu
Pyrite | Level 9

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. 

3 REPLIES 3
SASKiwi
PROC Star

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:

 

http://support.sas.com/documentation/cdl/en/acpcref/67382/HTML/default/viewer.htm#n0msy4hy1so0ren1ac...

 

PGStats
Opal | Level 21

You could also try STARTROW=  instead of DATAROW. It might still work.

PG
user24feb
Barite | Level 11

DBMS=Excel + Datarow does not work for me either. DBMS=XLSX + Datarow should work.

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 10080 views
  • 1 like
  • 4 in conversation