HP 3000 Manuals

Result(Columns 43-48) [ HP RPG/iX Reference Manual ] MPE/iX 5.0 Documentation


HP RPG/iX Reference Manual

Result(Columns 43-48) 

The Result Field identifies the field that contains the result of the
operation.  You may use a field name that is not defined elsewhere in the
program (if you do this, enter the length of the field in the Field
Length Field (columns 49-51).

          Table 8-19.  The Result Field 

----------------------------------------------------------------------------------------------
|              |                       |                                                     |
|   Columns    |         Value         |                     Description                     |
|              |                       |                                                     |
----------------------------------------------------------------------------------------------
|              |                       |                                                     |
|    43-48:    |   Name of a field,    | The area where the result is stored.                |
|              |   table, array, or    |                                                     |
|              | indexed array element |                                                     |
|              |                       |                                                     |
|              |         blank         | The Result Field is not used by this operation.     |
|              |                       |                                                     |
|    43-45:    |          *EQ          | The record that sets the lower limit (SETLL) for    |
|              |                       | sequential read operations must be equal to the     |
|              |                       | value in the Factor 1 Field.                        |
|              |                       |                                                     |
|              |          *GT          | The record that sets the lower limit (SETLL) for    |
|              |                       | sequential read operations must be greater than the |
|              |                       | value in the Factor 1 Field.                        |
|              |                       |                                                     |
|              |          *GE          | The record that sets the lower limit (SETLL) for    |
|              |                       | sequential read operations must be greater than or  |
|              |                       | equal to the value in the Factor 1 Field.           |
|              |                       |                                                     |
----------------------------------------------------------------------------------------------

[REV BEG]

The programmer is responsible for making sure the Result Field is large
enough to hold the result of the operation.  If an alphanumeric Result
Field is too small, the field is truncated on the left.  If the Result
Field is used in arithmetic or numeric compare operations, or if it is an
Output Specification field that is edited or zero suppressed, it must be
numeric.

For arithmetic operations, the Result Field will overflow and data will
be lost if the Result Field is not large enough to hold the result of the
operation.  With full numeric overflow checking enabled (through the
$CONTROL OVFLOCHK compiler command) an arithmetic overflow initiates the
overflow error trap.  You can control how your program handles the
overflow trap with entries in the Header Specification, columns 55 and
65.  If you disable full overflow checking for some calculations with the
$CONTROL NOOVFLOCHK compiler command (or if you haven't enabled full
checking), RPG may left-truncate the calculated value instead of
initiating the overflow error trap.  This happens when either Factor 1 or
Factor 2 is the same size or larger than the calculated value of the
operation, but the Result Field is too small to hold the value.  If the
size of the calculated value is larger than the size of each of Factor 1,
Factor 2, and the Result Field, then RPG initiates the overflow error
trap, regardless of the setting of OVFLOCHK.[REV END]



MPE/iX 5.0 Documentation