INT

Synopsis

HELP:   Integer-detector hints: locale, sign-convention, width, BCD variant, FRADIG
TYPE:   OBJECT
SYNTAX: INT(LOCALE=AUTO/ISO/DE/US/ANSI/FR/CH,SIGNCONV=AUTO/LEADING/TRAILING/ZONED/NONE,WIDTH=ALL/NONE/I16/I32/I64,BCD=ALL/NONE/ZONED/PACKED,FRADIG=num)

Description

The INT sub-object inside DETECT(HINTS(...)) carries integer-detector filters that restrict the type detector at bit-setting time. All hints are optional; omitting them keeps the detector at its default, which sets every plausible integer-subformat bit.

Locale

LOCALE narrows the locale set for integer detection (steers the default thousand separator). AUTO falls back to HINTS.LOCALE.

detect(hints(int(locale=DE))) -- expect 1.234.567 thousand grouping

Sign convention

SIGNCONV restricts which sign placements are recognised in FORMAT.STR integer detection.

detect(hints(int(signconv=LEADING))) -- only "+123" / "-123" detect(hints(int(signconv=ZONED))) -- only EBCDIC overpunch

NONE rejects all sign forms (the column must contain unsigned digits only).

Integer width

WIDTH restricts which binary integer widths DETFIX probes. This is a bitmask hint: combine values to allow several widths.

detect(hints(int(width=I32))) -- only 4-byte COMP-4 detect(hints(int(width=I16))) -- only 2-byte COMP-4 PIC S9(1..4) detect(hints(int(width=NONE))) -- skip binary integer probing

BCD variant

BCD restricts which BCD encodings DETFIX probes for integer-typed fields. Bitmask: combine values to allow several variants.

detect(hints(int(bcd=PACKED))) -- COBOL COMP-3 only detect(hints(int(bcd=ZONED))) -- COBOL DISPLAY numeric only detect(hints(int(bcd=NONE))) -- skip BCD probing

Fractional digits for BCD

FRADIG provides the fractional-digit count for BCD fields detected by DETFIX. DETFIX can determine whether a binary zone contains BCD data but cannot infer the number of decimal places from the raw bytes alone.

Example: a 4-byte COMP-3 field holding currency values with 2 decimal places is emitted as type.float(format.bcd(signed type=PACKED fracdigits=2)) when FRADIG=2 is set.

detect(hints(int(fradig=2 bcd=PACKED)))

Arguments