Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A macro variable can be referenced anywhere in a SAS program. (The only exception is in data lines that are being read into SAS.) A macro variable can be assigned text values. The value of a variable is stored in either a local or global symbol table. A macro variable name must be a valid SAS name. (#$#%@#$%#!! won't work, even though you might feel this way about a programming project.) A macro variable is preceded by an & when it is referenced in a SAS program. When a macro variable is resolved in a program, it might be closely associated with text. If it follows text, then it is referenced as text¯o-variable. If it precedes text, then it is referenced with a period delimiting the value from the text (¯o-variable.text). SAS can define certain macro variables (automatic macro variables), while a program can define other macro variables (userdefined macro variables.)
When you first start macro programming in SAS, you will most likely use macro variables to define simple substitutions in a program. In Display 10.5, the trapezoidal numerical integration routine is modified to address the previous questions.