HINTS

Synopsis

HELP:   Per-type detection hints (DATE/INT/FLT/BIN/STR sub-objects)
TYPE:   OBJECT
SYNTAX: HINTS(LOCALE=AUTO/ISO/DE/US/ANSI/FR/CH,CHRSET=AUTO/ASCII/EBCDIC,ENDIAN=SYSTEM/BIG/LITTLE/LOCAL,NULLST='str',DATE(YEARMIN=num,YEARMAX=num,PIVOT=num,LOCALE=AUTO/ISO/DE/US/ANSI/FR/CH,EPOCHBASE=AUTO/UNIX/LILIAN/J2000/EXCEL),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),FLT(LOCALE=AUTO/ISO/DE/US/ANSI/FR/CH,NOINFNAN,NOSCI,FAMILY=ALL/NONE/HFP/IEEE/DFP,FRASEP=SYSTEM/PERIOD/COMMA/APOSTROPHE,GRPSEP=NON/OFF/SYSTEM/PERIOD/COMMA/SPACE/APOSTROPHE,FRADIG=num),BIN(BASEPREF=AUTO/BASE16/BASE32/BASE64,BASE=num/ALL/NONE/HEX/BASE32/BASE64),STR(POLICY=AUTO/STRICT_ASCII/ALLOW_UTF8/ALLOW_CTRL,DEFASC='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL,DEFEBC='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL))

Description

The HINTS sub-object inside DETECT carries every per-type and cross-type filter the row-spec auto-detector uses. DETECT itself controls the row-spec detector flow (record sampling, sub-detector restrictions, output redirect, suppression switches); HINTS controls how the type detector picks subformats within a chosen family. All hints are optional; omitting them keeps the detector at its default behaviour: every plausible subformat bit is set, and the picker resolves via highest-bit-wins.

Cross-type scalars

LOCALE / CHRSET / ENDIAN / NULLST sit at the top of HINTS and apply to every detector unless overridden in a per-type sub-object.

AUTO weighs the bytes that tell the two character sets apart -- blanks, digits and letters sit at different code points in each -- and the side with the clear lead wins. Bytes printable in both, most punctuation, do not vote. A sample that leaves no clear lead is decided by the platform: EBCDIC in an EBCDIC environment, ASCII otherwise, because data with nothing to go by is most likely written in the character set of the machine processing it. Fixed-length records are the exception and keep the cautious ASCII classification in that case -- see the note in the fmttab.detect manual page.

detect(hints(locale=DE chrset=EBCDIC endian=BIG nullst="+TBD,-"))

Per-type sub-objects

DATE -- date detector hints:

INT -- integer detector hints:

FLT -- float detector hints:

BIN -- binary detector hints:

STR -- string detector hints:

Examples

Detect German banking data with historical dates back to 1800:

detect(hints(locale=DE date(yearmin=1800 yearmax=2026 pivot=30)))

Restrict integer detection to leading-sign style and disable Inf/NaN on float detection:

detect(hints(int(signconv=LEADING) flt(noinfnan=YES)))

Force base16-only binary detection (e.g. when known to be hexadecimal data despite syntactically also matching base64):

detect(hints(bin(basepref=BASE16)))

z/OS COBOL unload (EBCDIC, big-endian, packed BCD only).

detect(hints(chrset=EBCDIC endian=BIG int(bcd=PACKED width=I32) str(defebc='IBM-1141')))

Currency BCD with two fractional digits.

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

Arguments