ITONUM: Converting a Large Binary Integer to Double-Precision Format

How to:

Available Languages: reporting, Maintain

The ITONUM function converts a large binary integer in a non-FOCUS data source to double-precision format.

Some programming languages and some non-FOCUS data storage systems use large binary integer formats. However, large binary integers (more than 4 bytes in length) are not supported in the Master File so they require conversion to double-precision format.

You must specify how many of the right-most bytes in the input field are significant. The result is an 8-byte double-precision field.

Syntax: How to Convert a Large Binary Integer to Double-Precision Format

ITONUM(maxbytes, infield, output)

where:

maxbytes

Numeric

Is the maximum number of bytes in the 8-byte binary input field that have significant numeric data, including the binary sign. Valid values are:

5 ignores the left-most 3 bytes.

6 ignores the left-most 2 bytes.

7 ignores the left-most byte.

infield

A8

Is the field that contains the binary number. Both the USAGE and ACTUAL formats of the field must be A8.

output

Double precision floating-point (Dn)

Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be Dn.

Example: Converting a Large Binary Integer to Double-Precision Format

Suppose a binary number in an external file has the following COBOL format:

PIC 9(8)V9(4) COMP

It is defined in the EUROCAR Master File as a field named BINARYFLD. Its field formats are USAGE=A8 and ACTUAL=A8, since its length is greater than 4 bytes.

The following request converts the field to double-precision format:

DEFINE FILE EUROCAR
MYFLD/D14 = ITONUM(6, BINARYFLD, MYFLD);
END
TABLE FILE EUROCAR
PRINT MYFLD BY CAR
END