Converting Execs to %Macros
    

To convert your Exec to a global macro

1    Add three lines to your Exec file: GMACRO as the first line, ENDMACRO as the last line, and the template (the macro name) as the second line of the file.

2    Check for Minitab commands that work differently in %macros (below).

3    Save the macro as a text file, with the extension MAC.

Once you have converted your Exec to a global macro, you can incorporate any of the features documented in the chapters for global macros such as DO-loops and IF statements. You can also include several global macros within one global macro file.

Converting your Exec to a local macro

Local macros do not support the CK capability, which is a specialized looping feature exclusive to Execs. If your Exec uses the CK syntax, replace the syntax with the appropriate control statement .

Commands that work differently in %macros

·    Execs allow a repeat factor, such as "3" in the command EXECUTE "MYMACRO" 3. Global macros do not allow a repeat factor because they allow control statements such as DO-loops and WHILE statements which work much more efficiently. If your Exec requires such a repeat factor, you will need to incorporate that operation within the body of the global macro.

·    In earlier releases of Minitab, the default was ECHO. Now the default is NOECHO, which means that commands are not normally displayed while the macro executes. If your Exec contains NOECHO commands, there is no harm in leaving them there, but they may not be necessary anymore.

·    READ, SET, and INSERT commands should follow these conventions:

-    If the command reads data from a file, you must modify the command so that the file name is listed with a FILE subcommand, rather than being listed on the main command line.

-    If the command is followed by data, you must include the statement END at the end of the data, on its own line.

-    If the command is followed by a FORMAT subcommand followed by data, the END statement must begin at the beginning of the line. If END is indented at all, Minitab will not recognize it and you will get an error message.