Using Session Commands


Each menu command has a corresponding session command. Session commands consist of a main command and, usually, one or more subcommands. Main commands and subcommands can be followed by a series of arguments, which can be columns, constants, matrices, text strings, or numbers. You can use session commands to quickly re-run an analysis in current or future sessions, or as an alternative to menu commands. Minitab provides three ways to use session commands:
  • Type session commands into the Session window or the Command Line Editor.
  • Copy session commands from the History folder to the Command Line Editor.
  • Copy and save session commands in an exec file.

When you enable session commands, and then execute a command from a menu, the corresponding session commands are displayed in the Session window along with your text output. This technique is a convenient way to learn session commands.

The Western shipping center continuously collects and analyzes delivery time when new data are available. In Assessing Quality, you conducted a capability analysis on data from March. In this chapter, you use session commands to perform a capability analysis on data from April.

Enable and enter session commands

One way to use session commands is to enter them at the command prompt in the Session window. Minitab does not display the command prompt in the Session window by default, so you must enable it.

Enable session commands

  1. If you are continuing from the previous chapter, choose File > New > Project. If not, start Minitab.
  2. Choose Help > Sample Data.
  3. Double-click the Getting Started folder, then double-click SessionCommands.MTW.
  4. Click the Session window to make it active.
  5. Choose Editor > Enable Commands.

    The MTB> prompt is displayed in the Session window.

  6. (Optional) Enable session commands by default for all Minitab sessions.
    1. Choose Tools > Options. Expand Session Window, then select Submitting Commands.
    2. Under Command Language, click Enable.

Perform an analysis using session commands

In Assessing Quality, you performed a capability analysis to determine whether delivery times were within specifications (less than 6 delivery days). To perform this analysis, you used Stat > Quality Tools > Capability Analysis > Normal. Then, you entered the data column, the subgroup column, and the upper specification limit.

To continue assessing the delivery times at the Western shipping center, you plan to repeat this analysis at regular intervals. When you collect new data, you can repeat this analysis using a few session commands.

  1. In the Session window, at the MTB > prompt, enter CAPABILITY 'Days' 'Date'; The semicolon indicates that you want to enter a subcommand.
  2. Press Enter. Notice that MTB > becomes SUBC>. Use the SUBC> prompt to add subcommands for the options from the earlier capability analysis.
  3. At the SUBC> prompt, enter USPEC 6. The period indicates the end of a command sequence.
  4. Press Enter.
Capability analysis for the April shipping data

For more information about specific session commands, at the command prompt, enter Help and the first four letters of the command name.

Re-execute a series of commands

Minitab generates session commands for most menu commands and stores them in the History folder. You can re-execute these commands by selecting them and choosing Edit > Command Line Editor.

Use the History folder and the Command Line Editor to re-run the capability analysis.

  1. Choose Window > Project Manager.
  2. Click the History folder.
  3. Click CAPABILITY 'Days' 'Date';, press and hold Shift, and then click USPEC 6.
  4. Choose Edit > Command Line Editor.
  5. Click Submit Commands.
Capability analysis for the April shipping data

You have re-created the capability analysis in a few simple steps.

Repeat analyses with exec files

An exec file is a text file that contains a series of Minitab commands. To repeat an analysis without using menu commands or session commands, save the commands as an exec file and then run the exec file.


For more information about exec files and other more complex macros, choose Help > Help. Under References, click Macros.

Create an exec file from the History folder

Save the session commands for the capability analysis as an exec file.

  1. Choose Window > Project Manager.
  2. Click the History folder.
  3. Click CAPABILITY 'Days' 'Date';, press Shift, then click USPEC 6.
  4. Right-click the selected text, then choose Save As.
  5. Browse to the folder that you want to save your files in.
  6. In File name, enter ShippingGraphs.
  7. From Save as type, select Exec (*.MTB). Click Save.

Re-execute commands

You can repeat this analysis by running the exec file.

  1. Choose Tools > Run an Exec.
  2. Click Select File.
  3. Select the file, ShippingGraphs.MTB, then click Open.
Capability analysis for the April shipping data

Minitab executes the commands in the exec file to generate the capability analysis.

You can run an exec file using any worksheet if the column names match. Therefore, you can share an exec file with other Minitab users who need to perform the same analysis. For example, the manager of the Western shipping center can share ShippingGraphs.MTB with the managers of the other shipping centers so that they can perform the same analysis on their own data. If you want to use an exec file with a different worksheet or with different columns, edit the exec file using a text editor such as Notepad.

Save the project

Save all your work in a Minitab project.

  1. Choose File > Save Project As.
  2. Browse to the folder that you want to save your files in.
  3. In File name, enter MySessionCommands.
  4. Click Save.

In the next chapter

You learned how to use session commands as an alternative to menu commands and as a way to quickly repeat an analysis. In the next chapter, you create a report to show the results of your analysis to your colleagues.

By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy