UNLOAD

Synopsis

HELP:   Database unload format selector [NONE]
TYPE:   NUMBER
SYNTAX: UNLOAD=NONE/IMSL/IMSS/IMSH/IHDU/IMSL-BOTH/IMSL-WLEN/IMSL-WOLN/IMSS-BOTH/IMSS-WLEN/IMSS-WOLN/IHDU-BOTH/IHDU-WLEN/IHDU-WOLN/DB2U/DB2S/DB2IX

Description

Selects the database unload format for the binary input files. When set to any value other than NONE, each FORMAT schema file is wrapped in an unload envelope: a prefix block is prepended to every data row and an IMS_EOF catch-all drain row is appended last to absorb the end-of-file sentinel record.

NONE

No unload wrapping. The binary input is treated as a plain fixed-block (FB) file and each record is matched directly against the row specs generated from the FORMAT schema files. This is the default.

IMSL

IMS DFSURGU0 LONG format as produced by IBM z/OS DFSURGU0 with the LONG option. Each logical record begins with a 20-byte prefix:

Offset  Size  Field    Description
------  ----  -------  ------------------------------------------------
     0     2  LL       Total logical record length (big-endian halfword,
                        includes LL and ZZ fields)
     2     2  ZZ       Reserved, must be X'0000'
     4     1  PCF      Process control flag: X'04' = root segment,
                        X'00' = end-of-file sentinel
     5     1  PEF      Process event flag, reserved
     6     8  SEGNAM   Segment name (EBCDIC, space-padded to 8 bytes)
    14     2  SEQOFF   Sequence field offset (big-endian halfword)
    16     2  SEQLEN   Sequence field length (big-endian halfword)
    18     2  RES      Reserved
    20   n/a  Data     Segment data payload (record layout per copybook)

For each FORMAT schema file, one IMS_<SEGNAME> row spec is generated. The SEGNAM value used for matching is derived from the first 8 characters of the COBOL 01-level name (space-padded). For example, a copybook with a top-level record named BCSV-CHAR-REC produces a row spec matched against SEGNAM = 'BCSV-CHA'.

The input file must be RECFM=VB. The JCL LRECL must be set to the maximum logical record length (20-byte prefix plus the largest segment payload). QSAM automatically strips the 4-byte RDW before the program sees each logical record.

IMSS

IMS DFSURGU0 SHORT format as produced by IBM z/OS DFSURGU0 with the SHORT option. Each logical record begins with a 4-byte prefix:

Offset  Size  Field    Description
------  ----  -------  ------------------------------------------------
     0     2  LL       Total logical record length (big-endian halfword,
                        includes LL and ZZ fields)
     2     2  ZZ       Reserved, must be X'0000'
     4   n/a  Data     Segment data payload (record layout per copybook)

For each FORMAT schema file, one row spec is generated. Because the SHORT format carries no SEGNAM field, row specs are discriminated by record length (fixlen) only. An IMS_EOF catch-all drain row is appended last in the table to silently absorb the end-of-file sentinel record (LL=X'0004', ZZ=X'0000' -- a 4-byte record with no data payload).

The input file must be RECFM=VB. The JCL LRECL must be set to the maximum logical record length (4-byte prefix plus the largest segment payload). QSAM automatically strips the 4-byte RDW before the program sees each logical record.

The SHORT format does not carry a SEGNAM field. Without a segment name discriminator it is not possible to distinguish between multiple copybooks (segment types) that have the same record length. Use IMSL instead whenever the input database contains more than one segment type, or when any two copybooks have the same record length and cannot otherwise be told apart.

IHDU

IMS HD Unload (DFSURGL0) format -- a physical database image produced by IBM z/OS DFSURGL0 that contains each segment with its full IMS segment prefix. Each logical record in the VB file begins with a 36-byte physical prefix:

Offset  Size  Field        Description
------  ----  -----------  -------------------------------------------
     0     2  SEG-CODE     IMS segment code (big-endian halfword; order
                            in the DBD, e.g. 0x0180 for first segment)
     2     2  SEG-PRE-LEN  Length of the segment prefix
     4     2  ROOT-KEY-LEN Length of the root key
     6     8  DB-KEY       Database key (EBCDIC)
    14    20  POINTERS     Pointer block (twin-forward, child, etc.)
    34     2  MARKER       Delete/marker byte pair
    36   n/a  Data         Segment data payload (record layout per copybook)

For each FORMAT schema file, one IHDU_<SEGNAME> row spec is generated with the 36-byte prefix expressed as drain columns. Row routing uses record-length disambiguation (each segment type in the DBD has a distinct payload length in Wave 1). An IHDU_UNKNOWN catch-all drain row is appended last in the table to silently absorb header/trailer frames with SEG-CODE 0x0080 (DB header) or 0x0098 (DB trailer).

The input file must be RECFM=VB. The JCL LRECL must cover the largest segment payload plus the 36-byte prefix plus the 4-byte RDW. QSAM automatically strips the RDW before the program sees each logical record. Same-record-length segments from different DBD entries are supported via an optional Integer-isNext discriminator (Wave 2b, on request).

IMSH

IMS DFSURGU0 LONG format, Hewlett-Packard variant. Not yet supported.

DB2U

Db2 for z/OS DSNUTILB UNLOAD FORMAT UNLOAD. Variable-blocked (RECFM=VB) output from the Db2 UNLOAD utility. Each logical record (after stripping the 4-byte RDW) begins with a 2-byte big-endian OBID (Object Identifier), followed by column data. Nullable columns carry a 1-byte inline null indicator (X'FF'=NULL, X'00'=not null) immediately before the column data. VARCHAR columns have a 2-byte big-endian length prefix followed by the actual data bytes. Not yet supported.

DB2S

Db2 for z/OS DSNTIAUL sample program output. Fixed-blocked (RECFM=FB). All null indicators are grouped at the beginning of each row (one byte per nullable column in SELECT order; X'6F'=NULL, X'00'=not null), followed by the column data. VARCHAR columns are padded with X'00' to their maximum declared length (no length prefix). Not yet supported.

DB2IX

Db2 PC/IXF (PC Version of the Integration Exchange Format). A self-describing format containing H (header), T (table), C (column descriptor), and D (data) records with the file schema embedded in the C records; no external copybook is required. Not yet supported.

PER-FORMAT OVERRIDE

The global UNLOAD= parameter sets the unload envelope for all FORMAT copybooks at once. When a single BCSV run must process copybooks that require different unload wrappers, each FORMAT value may carry a trailing /%<token> suffix (e.g. FORMAT='PART.cpy/%imsl') that overrides the global UNLOAD= for that copybook only. The supported tokens are none, imsl, imss, and ihdu (case-insensitive). A FORMAT value without a /% suffix inherits the global UNLOAD= value. See the FORMAT parameter manual page for the full syntax and rules.

Selections