BookmarkSubscribeRSS Feed
nirupama1
Fluorite | Level 6

data abc;

 

if parm4="mon" then do;

%mdate;

end;

 

if parm4="qtr" then do;

%qdate;

end;

 

run;

 

I am getting error:

ERROR 180-322:Statement is not valid or it is used out of proper order.

Showing red mark(error) on END; statement in log.

 

How to resolve this error.Please provide me solution

 

2 REPLIES 2
Reeza
Super User

It's likely something in the macro code we cannot see. Please run the code with the macro debugging options and show us the log.

 

options mprint symbolgen;

@nirupama1 wrote:

data abc;

 

if parm4="mon" then do;

%mdate;

end;

 

if parm4="qtr" then do;

%qdate;

end;

 

run;

 

I am getting error:

ERROR 180-322:Statement is not valid or it is used out of proper order.

Showing red mark(error) on END; statement in log.

 

How to resolve this error.Please provide me solution

 


 

ballardw
Super User

Where do you get values to test for Parm4 ='mon' or anything?

 

Best practice for this forum when you receive any error message is to copy from the Log the entire data step or procedure along with any notes, messages, warnings or errors, open a code box on the forum using the </> icon and then paste the entire log.

 

Editing out parts you think are not needed is way too often important because of missing semicolons or mismatched quotes or parentheses prior to where the actual error gets reported.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 429 views
  • 0 likes
  • 3 in conversation