HELP: Schema file(s) (e.g. COBOL copybooks); format detected automatically [required unless ROWIN is set] TYPE: STRING SYNTAX: FORMAT['str'/STREAM/DUMMY...]
Specifies one or more schema files that describe the layout of the binary input records. Each schema file may define one or more record structures; each structure produces one CSV member in the output ZIP archive.
The file format is detected automatically by probing the available schema compilers in order. The decision is made on the content of the file; its name plays no part in it, so a schema transferred from a PDS library without an extension is read like any other.
Multiple values and wildcards are accepted. Globbing is applied to each value independently and the resulting file list is processed in order. At least one FORMAT file is required unless ROWIN is set.
COBOL copybooks (fixed-format or free-format source) are supported. Keywords are case-insensitive and identifiers use the standard COBOL character set. Continuation lines and sequence numbers in columns 1-6 are ignored.
All mappings below apply to the source record. PIC X/A/U columns are converted from the source CCSID (set by the CCSID parameter) to UTF-8 in the output CSV.
The field annotations DATE, CCSID, BINARY and OMIT are read from the *>
inline comment on the field line; see the BCSV command documentation for
the shared catalogue.
PIC X(n) and PIC A(n) -- Alphanumeric string fields Fixed-length string, n bytes. Stored in the source CCSID (EBCDIC unless overridden). In the CSV output the value is converted to UTF-8. With STYLE.TRIM=TRAILING, trailing EBCDIC spaces (0x40) are removed. Use the COLTYPE parameter to override individual fields to TYPE.BINARY (raw hex) or to a different CCSID when the default mapping is incorrect.
PIC U(n) -- UTF-8 string (IBM z/OS extension) Fixed-length UTF-8 field, n bytes. Always interpreted as UTF-8 regardless of the CCSID parameter. With STYLE.TRIM=TRAILING, trailing UTF-8 spaces (0x20) are removed.
PIC 9(n) USAGE DISPLAY (zoned decimal integer) n digit positions stored as EBCDIC digits. Maps to TYPE.INTEGER with FORMAT.BCD(TYPE=ZONED). An optional S prefix makes the field signed.
PIC 9(p)V9(s) USAGE DISPLAY (zoned decimal fixed-point) p+s EBCDIC digit positions with an implied decimal point after p digits. Maps to TYPE.FLOAT with FORMAT.BCD(TYPE=ZONED FRACDIGITS=s).
PIC 9(n) USAGE COMP / COMP-4 / BINARY (binary integer, big-endian) 2, 4, or 8 bytes depending on n (1-4 digits: 2 bytes; 5-9 digits: 4 bytes; 10-18 digits: 8 bytes). Big-endian byte order (z/OS network byte order). Maps to TYPE.INTEGER with FORMAT.BIN(ENDIAN=BIG).
PIC 9(n) USAGE COMP-5 (binary integer, native byte order) Same sizes as COMP/COMP-4. Uses the native byte order of the platform. Maps to TYPE.INTEGER with FORMAT.BIN() (system endian).
PIC 9(n)V9(s) USAGE COMP / COMP-4 / COMP-5 (binary fixed-point) Same byte sizes as integer COMP. Maps to TYPE.FLOAT with FORMAT.INT specifying the number of fractional digits.
USAGE COMP-1 (IBM HFP 4-byte float) IBM hexadecimal floating-point single precision (4 bytes). On z/OS this is IBM HFP format. On other platforms, IEEE 754 single precision is used (Wave 1 limitation). Maps to TYPE.FLOAT with FORMAT.BIN(TYPE=HFP ENDIAN=BIG).
USAGE COMP-2 (IBM HFP 8-byte double) IBM hexadecimal floating-point double precision (8 bytes). On z/OS this is IBM HFP format. On other platforms, IEEE 754 double precision is used (Wave 1 limitation). Maps to TYPE.FLOAT with FORMAT.BIN(TYPE=HFP ENDIAN=BIG).
USAGE FLOAT-SHORT (IBM DFP 4-byte decimal float, DFP32) IEEE 754-2008 Decimal Floating-Point short format (4 bytes, 7 significant decimal digits). Declared as USAGE FLOAT-SHORT with no PIC clause. Available on z/OS and z/Architecture systems with the DFP facility. Maps to TYPE.FLOAT with FORMAT.BIN(TYPE=DFP ENDIAN=BIG WIDTH=W32).
USAGE FLOAT-LONG (IBM DFP 8-byte decimal float, DFP64) IEEE 754-2008 Decimal Floating-Point long format (8 bytes, 16 significant decimal digits). Declared as USAGE FLOAT-LONG with no PIC clause. Maps to TYPE.FLOAT with FORMAT.BIN(TYPE=DFP ENDIAN=BIG WIDTH=W64).
USAGE FLOAT-EXTENDED (IBM DFP 16-byte decimal float, DFP128) IEEE 754-2008 Decimal Floating-Point extended format (16 bytes, 34 significant decimal digits). Declared as USAGE FLOAT-EXTENDED with no PIC clause. Maps to TYPE.FLOAT with FORMAT.BIN(TYPE=DFP ENDIAN=BIG WIDTH=W128).
PIC 9(n)V9(s) USAGE COMP-3 / PACKED-DECIMAL (BCD packed decimal) (n+s+1)/2 bytes of BCD-packed decimal with optional sign nibble. Maps to TYPE.FLOAT with FORMAT.BCD(TYPE=PACKED FRACDIGITS=s) for fixed-point, or TYPE.INTEGER with FORMAT.BCD(TYPE=PACKED) for integers. An optional S prefix enables signed interpretation.
PIC N(n) USAGE NATIONAL (national character set, UCS-2) Fixed-length national character field, 2*n bytes. Stored as UTF-16 big-endian (CCSID 1200) on z/OS. Maps to TYPE.STRING with FORMAT.CHRSET(CCSID='UTF-16' ENDIAN=BIG).
PIC G(n) USAGE DISPLAY-1 (DBCS graphic without shift bytes) Fixed-length DBCS graphic field, 2*n bytes, without SO/SI shift bytes. The CCSID is locale-specific and not set by the CCSID parameter. Maps to TYPE.BINARY (raw binary passthrough).
PIC G(n) (DBCS graphic with SO/SI shift bytes) As DISPLAY-1 but with 2 additional bytes for the SO (0x0E) and SI (0x0F) shift characters, totalling 2*n+2 bytes. Maps to TYPE.BINARY.
FILLER fields Anonymous alignment or padding bytes declared with the FILLER keyword are handled according to the STYLE.FILLER setting: * COLUMN (default): emitted as _FILLER_<offset> columns with TYPE.BINARY * ALIGN: absorbed by the preceding column using FORMAT.FIX(ALIGN=n)
REDEFINES Multiple alternative layouts for the same byte range. Each REDEFINES alternative produces a separate row spec; a data record is matched to the first row spec whose column layout is consistent with the record.
OCCURS Repeated occurrences are expanded to separate columns with indexed names (e.g. ITEM_1, ITEM_2, ...). The MAXOCCURS parameter limits expansion.
COPY COPY directives are expanded before parsing. The copybook is searched in the same directory as the FORMAT file. COPY ... REPLACING is not supported; such files are not recognized as COBOL (probing continues to the next compiler).
USAGE INDEX and USAGE POINTER fields are skipped and do not produce columns. Level-88 condition names are ignored.
Each FORMAT value may carry a trailing /%<unload> suffix that selects
the IMS/IHDU unload envelope for that copybook only, independently of the
global UNLOAD= parameter. This allows a single BCSV run to process a
heterogeneous list of copybooks where different copybooks require
different unload wrappers.
Syntax (case-insensitive):
FORMAT='path/PART.cpy/%imsl' FORMAT='path/SUB.cpy/%imss' FORMAT='path/FIX.cpy'
Supported tokens:
/%none -- no unload wrapping for this copybook (plain fixed-block)/%imsl -- IBM IMS DFSURGU0 LONG (20-byte prefix)/%imss -- IBM IMS DFSURGU0 SHORT (4-byte prefix)/%ihdu -- IMS HD Unload / DFSURGL0 (36-byte physical prefix)The tokens /%imsh, /%db2u, /%db2s, and /%db2ix are recognized
but rejected with a parameter error (not yet supported), consistent
with the global UNLOAD= parameter.
Rules:
/%<unload> suffix must be the LAST segment of the format
reference. It composes correctly with the /?member archive-member
selector and the /&ccsid charset qualifier, which must appear
before /%<unload> in the path./% suffix falls back to the global
UNLOAD= parameter value (fully backward compatible)./% that is not the last segment causes the
command to fail with a parameter error./% suffix is parsed only in FORMAT/copybook-reference context
and does not interfere with the % wildcard used in data-file
globbing on the INPUT parameter.PL/I structure definitions are compiled by the PLI2ROW schema compiler: DCL/DECLARE blocks with level numbers 1 to 15, UNION as the equivalent of REDEFINES, DIMENSION(n) expanded into numbered columns. The field annotations DATE, CCSID, BINARY and OMIT are read from the block comment behind the declaration. The full type mapping table is in the BCSV command documentation.
HLASM DSECTs are compiled by the ASM2ROW schema compiler: one column per labelled DS statement, one row per DSECT, and one further row per ORG back-reference. Natural alignment is honoured and appears as drain+skip columns. The field-level remarks DATE, CCSID, BINARY and OMIT are read from the text behind the DS operand. The full type mapping table is in the BCSV command documentation.
Support for C struct definitions as schema files is planned for a future release.
STREAM - Read from stdin or write to stdoutDUMMY - Read EOF or write nothing