Operand conversion rules—Data extract expressions


All terms associated with an arithmetic operator must be packed decimal. The expression processor will always attempt to convert a non-packed decimal term to a packed decimal.

Character data can be used in arithmetic operations only if the characters consist of 0 through 9, preceded by an optional sign (+ or -). Leading blanks are allowed. The character string cannot contain more than 16 digits, although the value itself including blanks and sign can be longer. An all blank field is treated as zero.

The following table defines the limits on operand length and the conversions performed for non-packed decimal operands used in an arithmetic expression.

Type of data

Maximum length

Conversion process

Character

16 digits preceded by an optional plus or minus sign and any number of blanks

The numeric character string is converted to a packed decimal number. The sign is set to X'D' if the number was preceded by a minus sign (-) or to X'C' if the number was preceded by a plus sign (+).

Hexadecimal

4 bytes

The hexadecimal value is treated as an unsigned binary number and converted to a positive packed decimal number with a maximum value of 4,294,967,295.

Zoned

16 bytes

The zoned decimal number is converted to a packed decimal number with the sign taken from the zone of the right-most zoned decimal byte.

Fixed

4 bytes

The fixed binary value is treated as a signed binary number and converted to a signed packed decimal number in the range of -2,147,483,648 to 2,147,483,647.

Unsigned Decimal

16 bytes (31 decimal digits)

The unsigned decimal number is converted to a packed decimal number with a plus sign (X'C').

Information
Example
&YYYY(&DATE) + 5
SEG(3:6C) * SEG(20:2Z)  / (SEG(3:1X) + SEG(38:2F) )

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Online Reorg for IMS 5.2