PLS C18 = C1-C17 c1*c2 c1*c3 c1*c4 c1*c5 c1*c6 c1*c7 c1*c8 c1*c9 c1*c10 c1*c11&
c1*c12 c1*c13 c1*c14 c1*c15 c1*c16 c1*c17;
PLS C18 = C1-C17 c1*c2 c1*c3 c1*c4 c1*c5 c1*c6 c1*c7 c1*c8 c1*c9 c1*c10 c1*c11 c1*c12 c1*c13 c1*c14 c1*c15 c1*c16 c1*c17;
When using READ, you can use a space or a comma to separate data entries. For example:
READ C1 C2
1 2
3,4
END.
KKCAT K1 K2 K3
KKNAME stores the name of column C in the constant K. For example, if you want to store the name of column C1 in the constant K4, use the following syntax:
KKNAME K4 C1
KKSET stores the text within the double quotes in the constant K. For example, if you want store the word Minitab in constant K5, use the following syntax:
KKSET K5 "Minitab"
Yes, you can use the WORKSHEET command with the CLOSE subcommand. Suppose you want to close a worksheet named "Worksheet 1". Use the following commands:
WORKSHEET "Worksheet 1";
CLOSE.
If you do not want the user to be prompted to save the worksheet that is being quit, you can also add the NOPROMPT subcommand:
WORKSHEET "Worksheet 1";
CLOSE;
NOPROMPT.
In a global or local macro, the command EXIT transfers control back to interactive Minitab.
In an exec, EXIT terminates Minitab.
Use the DTYPE command to store the data type as constants. For example, suppose you want the data type of C1 to be stored in K1.
If the column contains integers, real numbers, or date/time values, but it is formatted as text (i.e. the column number appears with a -T), K1 will equal 0.
If the suffixed variable has a determined range, you do not need to include it on the template. For example, you could declare columns b.1-b.10 and not include it on the template.
MACRO
SAMPLE a
MCOLUMN a b.1-b.10
If the suffixed variable has an undetermined range, the suffixed variable or the suffix must be defined on the template. For example, if n is a constant, you could include the entire suffixed variable or the suffix on the template.
MACRO
SAMPLE a b.1-b.n
MCOLUMN a b.1-b.n
OR
MACRO
SAMPLE a b n
MCOLUMN a b c.1-c.n
You could use an optional subcommand so that the suffixed variable with an undetermined range is on the template, but the user does not have to include it when invoking the macro. For example,
MACRO
SAMPLE a b;
OBS n.
MCONSTANT a b n
DEFAULT n = 600
LET n = a * b
Suppose you are writing a global macro and want to name the first available column in the worksheet "EMPTY". Here are the commands in a global macro named FINDNEXT.
GMACRO
FINDNEXT
DO K101 = 1:1000
DTYPE CK101 K102
IF K102 = 10
NAME CK101 "EMPTY"
EXIT
ENDIF
ENDDO
ENDMACRO
This macro assumes that you do not have more than 1000 columns and that constants K101, K102 and K103 are empty.
For more information about the DTYPE Session command, go to Minitab Session Command Help. Click Alphabetical Command List. Click DTYPE.
You can use the NAME command. For example, to name column C1 with the value of K1:
NAME C1 K1
# (Comment symbol)
Used to add comments to a Minitab macro or exec without interfering with the commands themselves. When executing commands, Minitab ignores everything from the comment symbol (#) to the end of the line.
In the example macro that follows, the comments have been added to explain what each line of command language will do:
GMACRO #Starts the global macro
rand 10 C1. #Adds 10 rows of random data to C1
ENDMACRO #Ends the macro
Adding comments can make it easier for others to use and edit your macros and exec files.