Tips:Color/syntax highlight code within macro function

From sasCommunity
Revision as of 08:44, 1 September 2016 by Paulkaefer (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

It can be frustrating when the steps inside a macro function are not syntax highlighted like the rest of your code.

To fix this, you can add a "dummy" macro declaration (%macro _; %mend _;) on the same line as the macro you want to color. Example:

Syntax highlight macro function.png

This can be useful for debugging your code. The dummy macro does not interfere with the original macro.

An alternative is to add the line %local a; %let a = %nrstr(%mend);   %* to get syntax coloring;

Syntax highlight macro function example 2.png

....see also

Submitted By paulkaefer (talk)