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.

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 16. 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
  • 910 views
  • 0 likes
  • 3 in conversation