Using Macros
see also
 

Minitab is usually used interactively, which means that each command carries out as soon as you click OK in a dialog box or enter it in the Session window. You can also use a Minitab macro -- a set of session commands stored in a file -- to automate a repetitive task, such as generating a monthly report, or to extend Minitab's functionality, such as computing a special test statistic. In other words, you can write macros tailored to your needs.

You start by typing the macro in a word processor or using the History pane of the Project Manager to record your actions. Once you create a macro file, you invoke it in the Session window or Command Line Editor. Type % followed by the macro file name, as in %mymacro.

Introducing Simple Macros

Macro Terms and Overview

Global Macro Structure

Creating a Global Macro

Invoking a Global Macro

Adding Control Statements

Adding Comments

Macros that Start Automatically

Finding Problems in Macros

Advanced Macros

Advanced Macros

Using Variables

Using Arguments

Using Subcommands

Local Macro Structure

Invoking a Local Macro

Example of a Local Macro

Writing a Template

Declaration Statements

Using Text Data

Using Suffixed Variables

Using Free Variables

Finding Variable Data Type

Controlling Macro Flow

Control Statement Overview

Invoking Macros from within Macros

Managing Input and Output

Data Management Overview

Prompting a User for Information

Handling Macro Errors

Handling Errors Overview

Interpreting Error Messages

Debugging Tools

Commands that Work Differently in Macros

Commands Not Allowed in Macros

Using Execs

Execs Overview

Converting Execs to % Macros

Creating an Exec

Example of Exec

Running an Exec

Creating Loops

Using Conditional Execution

Handling Arguments

Interactive Execs