

Reporting Facility Commands › CONTROL Command
CONTROL Command
(Area 4A)
The CONTROL command provides two distinct functions:
- It specifies the sequence in which the data is to be presented for a particular report.
- It specifies those fields to be designated as control break fields for a particular report. A control break field is a user-defined data field. When the value of the data field changes from one input record to the next, a control break occurs.
The format of the CONTROL command is:
►►─ CONTROL ─┬────────┬───────────────────────────────────────────────────────►
└─ SKIP ─┘
►─┬────────────────────────────────────────────────────────────────────────┬──►◄
│ ┌───────────────┐ │
└─┬─────┬─ fldnm ─┬──────────────┬─┬─────────┬─┬─────┬─▼─┬───────────┬─┴─┘
└─ ( ─┘ └─ ;sseq ──────┘ └─ 'lit' ─┘ └─ ) ─┘ ├─ SKIP ────┤
├─ NEWPAGE ─┤
└─ OPTPRT ──┘
- ( )
-
Parentheses surrounding the field and associated parameters indicate that the field is a control break field and a sequence field. The parentheses must be paired.
- fldnm
-
The field name specifies that the named field is to be a sort sequence field used to determine the final sequence of the output report for which this CONTROL command pertains.
- ;sseq
-
The sort sequence specifies that the individual field has a sort sequence. It is separated from the field name with a semicolon.
- ;A
-
Specifies that the field has an ascending sort sequence.
- ;D
-
Specifies that the field has a descending sort sequence.
- 'lit'
-
The literal specifies an alphanumeric literal to be used as the control break legend. You can specify a control break legend for any or all control break fields.
- SKIP
-
Specifies one of two optional functions:
- When the SKIP parameter immediately follows the CONTROL command, the printer skips to a new page at the end of the report before printing the GRAND TOTAL or END OF REPORT lines.
- When the SKIP parameter follows a control break field, it indicates that the report is to continue on a new page after completing the printing of totals for the current level of the specified control break field.
- NEWPAGE
-
Has the same function as SKIP when specified after a control break field, but also resets the page number on the output report to 1 when it causes a page eject on a control break.
- OPTPRT
-
OPTPRT following a control break field indicates the control break field will print only when it changes, occurs after a heading break, or occurs at control total time.
Note the following:
- You must code fields on the CONTROL command from left to right, representing major to minor sorting sequence.
- You can intermix sequence-only fields and sequence/control break fields. The total combined size of all fields on the CONTROL command cannot exceed 256 characters. You can specify up to 15 levels of control breaks.
- If you omit the CONTROL command for a single report run (Secondary mode), no sort is performed and the data prints in the order in which the records are presented to the Reporting Facility. When you omit the CONTROL command from a report group in a multiple report run, the Reporting Facility generates a CONTROL command such that the data for that report prints in the order in which the records are presented to the Reporting Facility.
- Fields enclosed in parentheses cause control breaks to occur even when no sort is performed.
- The system permits only one SKIP or NEWPAGE parameter.
- When printing TOTALS ONLY, the system ignores any SKIP or NEWPAGE parameter at the lowest level of control break. Otherwise, since no detail lines are printed, each total line would appear on a new page.
- The specification of a sort sequence parameter (;A or ;D) applies to the immediately preceding field name only. If you require descending sequence for multiple fields, repeat ;D for each field.
- Field names specified on the CONTROL command can be of any type (except a bit string) and all rules of field name definition apply. In other words, field names can specify scalar variables or array elements, and field name qualification is supported where appropriate.
- Control break legends (literals) can be specified only for control break fields.
- The CONTROL statement must come before any COMPUTE or SET command or erroneous results can occur.
Copyright © 2014 CA.
All rights reserved.
 
|
|