Problems with Minitab Macro for Capability

RoryA

Registered
Hello all.

I am a returner to Minitab Macros, and a novice at that.
I am wanting to resurect a Macro that was created in 2014 which will not run because versions of Minitab have changed and commands have been removed.

To re-learn the code I have started writing the macro again from scratch, and got stuck at what seems a simple point.
In the code below you can see I ask the user for input to run a Sixpack, and then ask questions about the results.
The Sixpack graph is not appearing until the macro has ended and all the questions have been asked, the last two of which cannot be answered without seeing the Sixpack.
What is used to get the Sixpack graph on the screen when it is run in the same order as the code?

I hope you can help, and thanks in anticipation.

GMACRO

CAPA

##BRIEF 0
NOecho
endmtitle

Mtitle "Auto-Run Minitab commands for data in column C1.";
Notitle.

NOTE What is your LOWER Spec Limit (LSL)?
SET c2;
FILE 'TERMINAL';
NOBS 1.
Let K2 = C2
NAME K2 "LSL = "
NAME C2 "LSL"
PRINT K2

NOTE What is your UPPER Spec Limit (USL)?
SET c3;
FILE 'TERMINAL';
NOBS 1.
Let K3 = C3
NAME K3 "USL = "
NAME C3 "USL"
PRINT K3

NOTE What is your Sub-group size (n)?
SET c4;
FILE 'TERMINAL';
NOBS 1.
Let K4 = C4
NAME K4 "SG Size (n) = "
NAME C4 "SG Size (n)"
PRINT K4

NOTE Please enter the PART NUMBER measured for this study
SET c5;
FILE 'TERMINAL';
NOBS 1.
Let K5 = C5
NAME K5 "Part Number = "
NAME C5 "Part Number"
PRINT K5

LET K55=CONCATENATE("Sixpack of Data. Part Number = ",K5)

##BRIEF 2

IF K2 < K3
Sixpack C1 K4;
Lspec K2;
Uspec K3;
Pooled;
AMR;
UnBiased;
OBiased;
Breakout 25;
Toler 6;
CStat;
Title K55;
Test 1.
ENDIF

##BRIEF 0

NOTE OOC Points
NOTE Please examine the I-MR or X-Bar and R chart for
NOTE Out Of Control (OOC) data points. OOC data points can indicate
NOTE the process that generated the data isn't stable
NOTE
NOTE Are all data points in control? (Y/N)

SET c6;
FILE 'TERMINAL';
FORMAT (A1);
NOBS 1.
LET K6=C6
PRINT K6
DELETE 1 C6

IF K6 = "y" OR K6 = "Y"
# MLABEL 10
NOTE
NOTE
NOTE Are the data points normal? Y/N
SET c7;
FILE 'TERMINAL';
FORMAT (A1);
NOBS 1.
LET K7=C7
PRINT K7
DELETE 1 C7
##BRIEF 2
IF K7 = "y" OR K7 = "Y"
NOTE
NOTE
NOTE Data is normal.
# GOTO 2
ELSEIF K7 = "n" OR K7 = "N"
NOTE
NOTE
NOTE Data is non-normal.
# would you like to exit analysis without running a capability study? Y/N
ENDIF
ELSEIF K6 = "n" OR K6 = "N"
NOTE Need to identify which distribution the data fits.
ENDIF

#ENDMTITLE

ERASE K2 - K7
ENDMACRO
 

Miner

Forum Moderator
Leader
Admin
I have written and used a few Minitab macros but am far from being an expert at it. The way that I have seen the specifications and subgroup size handled is to put each in a separate column and then specify those columns as subcommands when calling the macro.

Example:
%ASCENT C7 C5-C6;
STORE C9-C10;
STEP 2;
BASE C5;
RUNS 8.

In this example, BASE was a field similar to a specification. The value was entered in C5 prior to running the macro, which then pulled the value when it was run.

Regarding the other questions, rather than ask them during the macro run, can you PRINT them as part of the output? You cannot display the graph until the macro ends.
 
Top Bottom