When the SET Destination is a Number


The numerical value of the source field, determined as described below, is copied to the destination field. No formatting is performed on the destination field, which is stored in the binary or packed form appropriate to the destination field’s definition in the data dictionary. The source field value is rounded to the decimal positions of the destination field. If the destination field is not large enough to hold the integer part of the source field value, a numeric overflow condition results. Overflow processing is dependent on the use of OVERFLOW statements within the event point that contains the SET statement.

Source number

Number source fields are copied using conversion routines appropriate to the type and decimal positions of the source and destination fields. If the source field is null, the destination field is set to the destination field’s null value.

Source alpha

The source field is tested for a valid numeric value. To be valid, the source field must contain only digits, an optional decimal point, an optional leading or trailing sign, and optional leading and/or trail-ing spaces. If the source field is blank, the destination field is set to the destination field’s null value. If the source field does not contain a number, a non-recoverable error occurs.

Source date

The source field is converted to a packed decimal Gregorian date intermediate form, if necessary, before the copy operation. The integer packed decimal number representing the date is then copied to the destination field, ignoring the decimal positions of the destination field. For example, if the source field contains the value for January 1, 1988, and the destination field is defined with four digits to the left of the decimal point and two digits to the right of the decimal point, the destination field receives the value 880101.00.

Source logic

If the value of the source field is 1 (yes), the destination field is set to a value of 1. If the value of the source field is 0 (no), the destination field is set to a value of 0. If the value of the source field is blank, the destination field is set to null, according to the destination field’s definition in the data dictionary.