Macro to connect to Access Database to get to data - Minitab Macro help

M

minitabuser

hello,
I just started using the minitab macros. I need help. I want to write the macro to connect to Access Database to get to data and produce charts (after doing some calculation on the columns in the dataset). I can do this successbully if I hard code what I want to filter for. Now I want to change the code where I can ask the user to enter TEACHER's name and pull data only for that teacher and produce chart. can someone help?

initial code with hard coding that works is below:
gmacro
report1a
ODBC;
Connect "DSN=MS Access Database;DBQ=C:\Documents and Settings\kab0408\Deskt" &
"op\new database\Project Tracker\Project Tracker.mdb;DefaultDir=C:\Document" &
"s and Settings\kab0408\Desktop\new database\Project Tracker;DriverId=25;FI" &
"L=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;";
SQLString "SELECT `Accomplishments`,`Active Step`,`Actual Savings`,`Analyze" &
" Gate Review`,`Baseline Capability`,`Baseline Process Knowledge`,`Business" &
" Area`,`Business Case`,`Champion`,`Champion (Investment)`,`Control Gate Re" &
"view`,`Core Team`,`Cost Category`,`Date`,`Define Gate Review`,`Driver`,`Ex" &
"pected Savings`,`Future Action Items`,`Goals`,`Green Belt (Investment)`,`I" &
"mpact`,`Improve Gate Review`,`Improved Capability`,`Key Metrics`,`Key Stak" &
"eholders`,`Learning System`,`Measure Gate Review`,`Measurement Analysis`,`" &
"Name`,`Optimal Process Condition`,`Percent Complete`,`Prioritized Factors`" &
",`Problem`,`Process or Product`,`Process Validation Results`,`Project Clos" &
"e Date`,`Project Closure Notes`,`Project Level`,`Project Number`,`Project " &
"Start Date`,`Project Status`,`Project Title`,`Project Type`,`Risks & Barri" &
"ers`,`Root Cause Detail`,`Savings Type`,`Selection & Scoping`,`Side Effect" &
" Analysis`,`Supporting File Location`,`Teacher`,`Team (Investment)`,`Team " &
"PIN`,`Time Commitment`,`Validation Date`,`Week Number` FROM `Data 1` where" &
" `Teacher` = 'KB' ".
Subset;
Where " 'Project Status'=""Proving Out"" Or 'Project Status'=""Complete"" And 'Active " &
"Step' <> ""x cancelled""";
Note ** Where "'Project Status'=""Proving Out""";
Name "Data Subset for teacher";
NoMatrices;
NoConstants;
Include.
NOTE Results for: Data Subset for teacher
NOTE *** Data window was used to change the worksheet
Sort 'Accomplishments'-C55 'Accomplishments'-C55;
By 'Project Start Date'.

Let C56 = ('Control Gate Review'-'Project Start Date')/30
TSPlot C56;
Stamp 'Project Start Date';
Symbol 'Project Level';
Connect 'Project Level'.
EndMacro


Also where can I find a good resource on syntax and advanced macro?

thanks for help.
 
G

GoLions

It sounds like you are looking for the SET command. For example, here are commands to prompt a user for the name of a histogram:

Note 'What is your title?'
Set c1000; #c1000 should be empty so it's not overwritten
File "terminal";
Format (A50);
Nobs 1.
Copy c1000 k1;
Use 1.
hist c1;
title k100.

In Minitab, enter the command "help session" to get to the command help. Also, Minitab offers free tech support (814-231-2682).
 
Top Bottom