Macro resolution tracking

In the preceding example, we are able to create the New dataset when we run the macro definitions. However, the value of the macro variable isn't written to the log. This was an instance of a single macro variable. Most macros in real life may contain multiple nested macros, with many macro variables in each nested macro. In such a situation, it is helpful to know what the resolution of the macro variable is. Adding a %PUT statement can be very helpful:

%Let File = Class;Data New;  Set &File;  New_Weight=Weight*1.1;Run;%PUT The resolution of macro variable File is &File;The %PUT statement helps write the resolution of the macro variable File to the LOG. Below is the message in the LOG.NOTE: There were 19 observations ...

Get Hands-On SAS for Data Analysis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.