COLTYPE

Synopsis

HELP:   Type override: 'pattern/&value'; value is 'binary' or a CCSID name [none]
TYPE:   STRING
SYNTAX: COLTYPE['str'...]

Description

Specifies type overrides for alphanumeric (byte-array) fields compiled from schema files. By default, FMT2TAB treats alphanumeric fields (COBOL PIC X/A, PL/1 CHAR, C char[]) as text strings in the source CCSID. COLTYPE lets you override individual fields to binary or a different CCSID.

Each value must have the form 'pattern/&value', where:

pattern Wildcard pattern matched case-insensitively against the field name from the schema file. Standard wildcards apply: '*' matches any sequence, '?' matches any single character.

value One of: binary -- emit the field as TYPE.BINARY (hex passthrough) <ccsid> -- override the character set; the value is used verbatim as the CCSID name in TYPE.STRING(CHRSET(CCSID='<ccsid>'))

Multiple COLTYPE values are accepted. The first matching entry wins. Fields that do not match any pattern use the default type mapping (string in the source CCSID set by the CCSID parameter).

COLTYPE is applied only to alphanumeric (byte-array) fields such as COBOL PIC X/A, PL/1 CHAR, or C char[]. Numeric, binary, and Unicode types (COBOL PIC 9/N/G/U, PL/1 FIXED/FLOAT/BIT, ...) are not affected.

Examples

Treat all fields whose name contains 'BIN' as raw binary:

bcsv format='MYREC.cbl' coltype='BIN/&binary' ...

Use IBM-037 for ADDR fields and binary for HASH fields:

bcsv format='MYREC.cbl' coltype['ADDR/&IBM-037' 'HASH/&binary'] ...

Escape hatch: NORUN + ROWOUT + ROWIN

For full control over the generated row-spec TABLE string, use NORUN together with ROWOUT to write the compiled TABLE string to a file:

bcsv format='MYREC.cbl' norun rowout='schema.tab'

Edit schema.tab manually, then feed it back with ROWIN (FORMAT is ignored when ROWIN is set):

bcsv rowin='schema.tab' input='data.bin' output='out.zip'