Advanced Macros
    

Local macros are more complex than global macros, and thus harder to write. However, they are more powerful and flexible. If you need to write a fairly complex macro, or if you want a macro which you can execute like a Minitab command, then you should write a local macro.

Local macros can use temporary variables, arguments, and subcommands to enhance the processing capabilities of the macro. Local macros also have a different structure that allows you to include areas for defining the common commands and the variables.

Local Macro Elements

Local macros have the capability to handle several elements which improve the processing capabilities of your macro. These following three elements are explained further:

Variables - Using Variables

Arguments - Using Arguments

Subcommands - Using Subcommands

Local Macro Structure

Template

Global macros use the template for naming purposes. Local macros use the template for naming the macro, but more importantly use the template for storing commands, subcommands and arguments. Writing a Template

Declaration statements

The data variables that are used throughout a local macro need to be defined as columns, constants, or matrices. Declaration statements define the variable data type. Declaration Statements