DATA Step, Macro, Functions and more

open code in macro

Reply
Contributor
Posts: 74

open code in macro

weird thing: in a macro I had included several scripts using %include. in these scripts I had codes like %if - %then %do - %end. I got error message like:

ERROR: The %IF statement is not valid in open code.

I dont understand how this happened. all these %if stuff are still within the macro, right? Help appreciated!!!
Valued Guide
Posts: 2,175

Re: open code in macro

that %include is passed through by the macro language compiler. The code is not opened and interpreted by that compiler, so %if is not valid once the syntax is out of the scope of the macro language compiler.
Super Contributor
Super Contributor
Posts: 3,174

Re: open code in macro

Suggest the OP try some additional SAS OPTIONS settings (below) to diagnose further:

OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MPRINT /* MLOGIC */;


Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 2 replies
  • 129 views
  • 0 likes
  • 3 in conversation