BookmarkSubscribeRSS Feed
abdullala
Calcite | Level 5
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!!!
2 REPLIES 2
Peter_C
Rhodochrosite | Level 12
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest the OP try some additional SAS OPTIONS settings (below) to diagnose further:

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


Scott Barry
SBBWorks, Inc.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1364 views
  • 0 likes
  • 3 in conversation