Mainframe Connector data types

This page describes all the data types that Mainframe Connector supports.

Universal field modifiers

All sized elementary COBOL fields support the following universal transcoder field modifiers (configured using defaults, field_suffixes, or field_overrides):

  • null_if: Decodes or encodes NULL based on an indicator field's value.
  • null_if_empty: Decodes as NULL if all bytes in the field are 0x00 (low-values); encodes NULL as 0x00 bytes.
  • decode_as_null: Decodes as NULL if all bytes match a configured hex_bytes value (for example, "40" for EBCDIC spaces, "00" for low-values, or "FF" for high-values) or if the decoded value matches a list of values.
  • encode_null_as: Encodes NULL as a repeated hex_byte or a specific default value.
  • null_if_invalid: Decodes invalid field data as NULL instead of sending the rejected record to the spillover dataset.
  • bytes: Overrides the field to read and write raw BYTES without character decoding.
  • filler: Excludes the field from the decoded output schema and fills it with hex_byte (default 0x40) during encoding.
  • chain: Applies multiple field modifiers in sequence.

COBOL data type mapping table

COBOL usage type Additional supported field modifiers Copybook or modifier condition Logical type ORC type BigQuery data type
COMP-1, COMP-2
(COMPUTATIONAL-1, COMPUTATIONAL-2)
hfp COMP-1 (4-byte single precision) or COMP-2 (8-byte double precision) with no PICTURE clause, or any 4- or 8-byte field with the hfp modifier. Double double FLOAT64
BINARY, COMP, COMPUTATIONAL, COMP-4, COMP-5 (Signed) binary
format_date
Default for binary fields, or when binary.signedness is set to SIGNED.
Byte size by precision (p):
  • p ≤ 4: 2 bytes
  • 5 ≤ p ≤ 9: 4 bytes
  • 10 ≤ p ≤ 18: 8 bytes
(Also supports 1, 2, 4, or 8-byte fields using the binary modifier.)
Long bigint INT64
BINARY, COMP, COMPUTATIONAL, COMP-4, COMP-5 (Unsigned) binary
format_date
binary modifier is applied with signedness set to UNSIGNED. Long bigint INT64
DISPLAY (or any sized field as raw bytes) bytes Any field with a static byte size that has the bytes field modifier applied (via field_overrides, field_suffixes, or defaults). Bytes binary BYTES
DISPLAY (or integer Long field) as Date format_date
string
String field (DISPLAY, DISPLAY-1, NATIONAL, UTF-8) or integer field (Long logical type) with the format_date modifier and a format entry matching the field's character length (for strings) or digit precision (for integers). Date date DATE
DISPLAY (String) as Timestamp format_timestamp
string
String field with the format_timestamp modifier and a format entry matching the field's byte size. Timestamp timestamp TIMESTAMP
DISPLAY (*) (Alphanumeric) string USAGE DISPLAY (or omitted USAGE) with an alphanumeric, alphabetic, or alphanumeric-edited PICTURE (X, A, B, 0, /).
  • If USAGE is omitted and PIC is N, treated as NATIONAL.
  • If USAGE is omitted and PIC is U, treated as UTF-8.
String string STRING
DISPLAY-1 (DBCS) string USAGE DISPLAY-1 with PIC G (optionally with B) or PIC N. Each symbol occupies 2 bytes. String string STRING
NATIONAL string USAGE NATIONAL with PIC N (or omitted USAGE with PIC N). Each symbol occupies 2 bytes. String string STRING
UTF-8 string USAGE UTF-8 with PIC U (or omitted USAGE with PIC U). String string STRING
DISPLAY (GROUP) (Variable-length string) varlen A group field with the varlen modifier containing two subfields:
  1. A length subfield with logical type Long (e.g., BINARY, ZONED, or PACKED-DECIMAL with precision ≤ 18 and scale = 0).
  2. An unmodified string subfield (DISPLAY, DISPLAY-1, NATIONAL, or UTF-8).
String string STRING
PACKED-DECIMAL
(COMP-3, COMPUTATIONAL-3)
packed_decimal
format_date (when Long)
precision ≤ 18 and scale = 0
(or packed_decimal.logical_type set to LONG)
Long bigint INT64
PACKED-DECIMAL
(COMP-3, COMPUTATIONAL-3)
packed_decimal precision ≤ 18 and scale > 0
(or packed_decimal.logical_type set to DECIMAL64)
Decimal64 decimal(p, s) NUMERIC
PACKED-DECIMAL
(COMP-3, COMPUTATIONAL-3)
packed_decimal 19 ≤ precision ≤ 38 and scale = 0
(or packed_decimal.logical_type set to BIG_INTEGER)
BigInteger decimal(38, 0)
  • INT64 (p = 19)
  • NUMERIC (20 ≤ p ≤ 38)
  • BIGNUMERIC (p > 38)
PACKED-DECIMAL
(COMP-3, COMPUTATIONAL-3)
packed_decimal 19 ≤ precision ≤ 38 and scale > 0
(or packed_decimal.logical_type set to BIG_DECIMAL)
BigDecimal decimal(p, s)
  • NUMERIC (p ≤ 38 and s ≤ 9)
  • BIGNUMERIC (p > 38 or s > 9)
ZONED
(DISPLAY with numeric PICTURE)
zoned_decimal
format_date
precision ≤ 18 and scale = 0
(or zoned_decimal.logical_type set to LONG)
Long bigint INT64
ZONED
(DISPLAY with numeric PICTURE)
zoned_decimal precision ≤ 18 and scale > 0
(or zoned_decimal.logical_type set to DECIMAL64)
Decimal64 decimal(p, s) NUMERIC
ZONED
(DISPLAY with numeric PICTURE)
zoned_decimal 19 ≤ precision ≤ 38 and scale = 0
(or zoned_decimal.logical_type set to BIG_INTEGER)
BigInteger decimal(38, 0)
  • INT64 (p = 19)
  • NUMERIC (20 ≤ p ≤ 38)
  • BIGNUMERIC (p > 38)
ZONED
(DISPLAY with numeric PICTURE)
zoned_decimal 19 ≤ precision ≤ 38 and scale > 0
(or zoned_decimal.logical_type set to BIG_DECIMAL)
BigDecimal decimal(p, s)
  • NUMERIC (p ≤ 38 and s ≤ 9)
  • BIGNUMERIC (p > 38 or s > 9)