DATA Step, Macro, Functions and more

Error in IF OR in Macro (%IF %OR %THEN %DO)

Accepted Solution Solved
Reply
Super Contributor
Posts: 503
Accepted Solution

Error in IF OR in Macro (%IF %OR %THEN %DO)

Hi Everyone,

I got this line wrong but not sure why.

Can you help me?

Thank you.

HHCFX

 

		%if %sysfunc(MOD(&X,6))=0 %or &X=&outer1_nobs %then %do;

WARNING: Apparent invocation of macro OR not resolved.


Accepted Solutions
Solution
‎03-28-2018 02:39 PM
PROC Star
Posts: 1,300

Re: Error in IF OR in Macro (%IF %OR %THEN %DO)

it is just or and not %or like

 

		%if %sysfunc(MOD(&X,6))=0 or &X=&outer1_nobs %then %do;

 

View solution in original post


All Replies
Solution
‎03-28-2018 02:39 PM
PROC Star
Posts: 1,300

Re: Error in IF OR in Macro (%IF %OR %THEN %DO)

it is just or and not %or like

 

		%if %sysfunc(MOD(&X,6))=0 or &X=&outer1_nobs %then %do;

 

Super Contributor
Posts: 503

Re: Error in IF OR in Macro (%IF %OR %THEN %DO)

Posted in reply to novinosrin

Oh, thank you.

 

PROC Star
Posts: 1,300

Re: Error in IF OR in Macro (%IF %OR %THEN %DO)

Basically  macro language still uses the same operators as does the sas language. However the statements, functions do have a prefix % to trigger the macro processor before the processed statements are sent to the compiler for execution.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 96 views
  • 1 like
  • 2 in conversation