A Read Access Violation can occur when you submit a macro invocation


When you place macro statements on a single line, a subsequent macro invocation might generate a Read Access Violation error.

For example, this issue occurs when you submit code similar to the following:

%if 1 %then %do; %put test; %end;
 
%macro abc_run;

As a result, the following errors occur in the SAS log:

ERROR:  An exception has been encountered.

ERROR:  Read Access Violation Program

Exception occurred at (06BC9603)

Task Traceback

Address   Frame     (DBGHELP API Version 4.0 rev 5)

0000000006BC9603  0000000006A4DAA0  sasxmac:tkvercn1+0x485C3

0000000006B925BF  0000000006A4EBC0  sasxmac:tkvercn1+0x1157F

0000000006BBB6CE  0000000006A4EFB0  sasxmac:tkvercn1+0x3A68E

000000000584C0DA  0000000006A4EFB8  sasxshel:tkvercn1+0x3B09A

This issue occurs at the SAS® 9.4M6 (TS1M6) release and is fixed at SAS® 9.4M9 (TS1M9) with a hot fix.

Workaround

To work around this issue, place all macro code on individual lines instead of a single line.

%if 1 %then %do; 
  %put test; 
%end;