|
The following examples are put together into a more complex RUN file at the end of the article.
1. Prompt for a date range
One of the most useful elements to include within a RUN file is a custom date range which allows the user to select a start and end date for the data to be analysed. The following box is presented to the user when the RUN file is executed:

The syntax required in the RUN file is as follows:
PROMPT $RANGEFILTER1 Enter the range of dates to be used:
The variable for "$RANGEFILTER1" is then used within the filter section of the chart command, so the entire RUN file appears as follows:
PROMPT $RANGEFILTER1 Enter the range of dates to be used:
IR "C:\Program Files\QA\Tutorial\ELEMENTS.DAT" PB I N G $FILTER="DATE $RANGEFILTER1"
CHART
The resulting RUN file prompts the user to specify a FROM and TO date for the data to be charted and then produces an Individuals Chart based on this data.
2. Prompt for the file to be analysed
This simple command allows you to use the same RUN file to analyse data from different Quality Analyst datafiles stored in the same location. This is ideal where the datafiles are all individually named by Lot Number or Serial number
The following box is presented to the user when the RUN file is executed:

The user can now enter "elements" to use the data from the elements.dat datafile. The syntax required in the RUN file is as follows:
PROMPT $FILE1 Enter the data file to use
It is then necessary to include the variable "$FILE1" within the context of the RUN file so that the correct datafile is used, the full syntax is as follows:
PROMPT $FILE1 Enter the data file to use
IR "C:\Program Files\QA\Tutorial\$FILE1.DAT" PB I N G
CHART
3. Include a dropdown list of values for the user to choose from
When a datafile contains multiple variables it is useful to be able to select which information should be charted. The following box can be displayed when the RUN file is executed to prompt the user to select from a list of predefined options.

This feature is particularly useful as it gives each variable a name which can be customised. For example, within the elements.dat datafile, the variable for Lead is "PB" however in the drop down list it appears as "Lead". The syntax required in the RUN file is as follows:
AskList ^Element ["AS":"Arsenic"|"PB":"Lead"|"ZN":"Zinc"] "Select an element to analyze:" "Lead"
IR "C:\Program Files\QA\Tutorial\Elements.DAT" ^Element I N G
CHART
Note that the above example defines the variable "^Element" which is then used within the context of the IR charting command to specify which variable should be used in the chart itself. In addition the variable "Lead" is selected as the default option.
4. Bringing it all together
Now that we have seen each option working individually, we can include these together into a single RUN file which will ask the user to:
A. Specify the datafile to be used
B. Specify the date range they want to analyse
C. Specify the variable they want to chart
The syntax for this is as follows:
PROMPT $RANGEFILTER1 Enter the range of dates to be used:
PROMPT $FILE1 Enter the data file to use
AskList ^Element ["AS":"Arsenic"|"PB":"Lead"|"ZN":"Zinc"] "Select an element to analyze:" "Lead"
IR "C:\Program Files\QA\Tutorial\$FILE1.DAT" ^Element I N G $FILTER="DATE $RANGEFILTER1"
CHART
The above syntax can be applied to a range of charts and will allow you to create more complex RUN files which can be used for a greater range of analysis. For further information regarding RUN file syntax please see Chapter 9 in the Quality Analyst PDF manual which is located in C:\Program Files\QA\QAMAN.PDF
|