BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
shasank
Quartz | Level 8

Hi Community, 

 

I am having issues debugging my Proc Import code. I tried multiple ways but still issue persisted. 

 

proc import datafile="C:\FilePath\Test_report.xlsx"  DBMS=Excel REPLACE out=test;
    SHEET="Rep01_mat";
	getnames=YES;
	namerow = 4;
	datarow=5; 	
run;

Here is the error I get

 

706      getnames=YES;
2707      namerow = 4;
          -------
          180
2708      datarow=5;
          -------
          180
ERROR 180-322: Statement is not valid or it is used out of proper order.

2709  run;

The variable names are in Row 4 and data in row 5. 

 

Any thoughts and suggestions are appreciated. 

 

Thank you for your time. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
shasank
Quartz | Level 8

I have found the answer through some testing. 

 

proc import datafile="C:\filepath\report.xlsx" DBMS=Excel REPLACE out=test;
SHEET="REP01_mat";
Range = "REP01_mat$A4:K0";
getnames=Yes;
run;

View solution in original post

1 REPLY 1
shasank
Quartz | Level 8

I have found the answer through some testing. 

 

proc import datafile="C:\filepath\report.xlsx" DBMS=Excel REPLACE out=test;
SHEET="REP01_mat";
Range = "REP01_mat$A4:K0";
getnames=Yes;
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 1159 views
  • 0 likes
  • 1 in conversation