Automating Metrics: Minitab Macros

I have been working with a few students about using Minitab to generate performance metrics for use in their business. If you do this by hand it is very time consuming. I will talk about a few topics that can help you take the labor out of it.

Here at Smarter Solutions, we have automated our metrics to reduce the labor and have been improving it for the past few years. We have not taken it to the next step which would be using the COM enabled programming that has been included into V15. I do not quite understand it yet, so I will talk on what we do use.

Macros in Minitab are not the same as in other programs, so do not be scared. They are more like what Excel and Lotus had years ago. They are just text files with command lines. You can write them with notepad.

If you did not realize it, the Minitab we use is just a graphical user interface that generates a bunch of code statements that are used behind the scenes. You have the ability to see these commands in the history section of Minitab.

Basic Format in the text file

Always starts with the same two lines at the start and the same command at the end.

GMACRO
template_name
body of the macro
ENDMACRO

The body of a macro consists of command language that controls the automatic data processing. The language includes:
Minitab commands
Control statements
Macro statements (such as IF, THEN, PAUSE, CALL and GOTO)
Invocation of other global macros
(the last info is from the minitab help files)

The template name is just what you call it, and must be included but is not used until you get involved with complex macros.

Now a couple of format items for Minitab. In the macro, a semicolen (;) implies there are more options in the command coming. A period (.) indicates the end of a command.

In between those lines you put the commands, used by Minitab.

What can you do and not do with a macro?

You can not open or close a project. Almost anything else is possible.

Here is an example of a macro that does a graphical summary of column c1.

gmacro
simpleexample.

GSummary c1.

endmacro.

Macros are saved as text files with a suffix of .mac.

They are generally in a subdirectory of your minitab installation files on your C drive. You can find the location (or change it) from choosing the Tools>Options function in Minitab.

To execute a macro, you type

%filename

into the command line editor.

More later.

Comments are closed.