EXCEPT (Calculation Time Output)
Free-Form Syntax | EXCEPT {except-name} |
Code | Factor 1 | Factor 2 | Result Field | Indicators | ||
---|---|---|---|---|---|---|
EXCEPT | except-name |
The EXCEPT operation allows one or more records to be written during either detail calculations or total calculations. See Figure 1 for examples of the EXCEPT operation.
When specifying the EXCEPT operation remember:
- The exception records that are to be written during calculation time are indicated by an E in position 17 of the output specifications. An EXCEPT name, which is the same name as specified by the except-name operand of an EXCEPT operation, can be specified in positions 30 through 39 of the output specifications of the exception records.
- Only exception records, not heading, detail, or total records, can contain an EXCEPT name.
- When the EXCEPT operation with a name specified in the except-name operand is processed, only those exception records with the same EXCEPT name are checked and written if the conditioning indicators are satisfied.
- When no except-name is specified, only those exception records with no name in positions 30 through 39 of the output specifications are checked and written if the conditioning indicators are satisfied.
- If an exception record is conditioned by an overflow indicator on the output specification, the record is written only during the overflow portion of the RPG IV cycle or during fetch overflow. The record is not written at the time the EXCEPT operation is processed.
- If an exception output is specified to a format that contains
no fields, the following occurs:
- If an output file is specified, a record is written with default values.
- If a record is locked, the system treats the operation as a request to unlock the record. This is the alternative form of requesting an unlock. The preferred method is with the UNLOCK operation.
For more information, see File Operations.