MODE |
|
|
The MODE field qualifier keyword causes a field to be reported together with its mode value.
Format
MODE field {field.qualifiers} {NO.NULLS}
where
The MODE field qualifier keyword is placed before the field name to which it applies and causes the query processor to report the value of the field for each record processed and also to report the mode value (the most frequently occurring value) at the end of the report. Used with breakpoints, the MODE keyword will also report the mode value of the field at each breakpoint.
Where more than more than one value shares the most frequent occurrence, it is not defined which one will be shown.
If the field is defined as multivalued, the MODE keyword operates on each value in turn.
The NO.NULLS keyword can be used to prevent null values being included in the calculation of the mode value.
Example
The sentence
LIST SALES MODE ITEM DESCR
would produce a display such as that below in which the most frequently sold item code is shown at the bottom of the ITEM column.
LIST SALES MODE ITEM DESCR Sales Item Description.................... 12140 003 Pen, blue 122 Whiteboard, medium 234 Paper, 100g A4 5 x 500 sheets 121 Whiteboard, small 12347 004 Pen, green 131 Flipchart paper 232 Paper, 80g A4 5 x ...etc... 12012 031 Ruler, 6 inch 003 Pen, blue ==== 003
See also: |