Referencing Dynamics and Macro Variables

After dynamics and macro variables are declared, you can make one or more template references to them by simply using the name of the dynamic or macro variable in any valid context. These contexts include the following:
  • as argument or option values:
    seriesplot x=date y=YVAR / curvelabel=YLABEL
      curvelabellocation=LOCATE datatransparency=TRANS;
    
  • as parts of concatenated text strings:
    entrytitle "Time Series for " YLABEL;
    entryfootnote "Created on " SYSDATE;
    
Dynamics and runtime macro variable references cannot be used in place of statement or option keywords, or in place of punctuation that is part of the syntax (parentheses, semicolons, and so on).
Note: If you precede a macro variable reference with an ampersand (&), the reference will be resolved when the template is compiled, not when it is executed.
For example, it is permissible to define TRANS as an MVAR for use in the following context:
proc template;
 define statgraph timeseries;
  dynamic YVAR YLABEL;
  mvar LOCATE TRANS;
  begingraph;
    layout overlay;
      seriesplot x=date y=YVAR  / curvelabel=YLABEL
        curvelabellocation= LOCATE datatransparency= TRANS ;
    endlayout;
  endgraph;
 end;
run;
This context is valid because an automatic, internal conversion using the BEST. format will be performed (with no warning messages).