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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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