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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1772 views
  • 0 likes
  • 1 in conversation