TERSE

Synopsis

HELP:   IBM TRSMAIN/AMATERSE data compression technique (method 18)
TYPE:   OBJECT
SYNTAX: TERSE(MODE=PACK/SPACK,HDRTYP=NATIVE/COMPAT,ISHOST,RATIO=num,SKIP)

Description

The TERSE compression technique implements the IBM TRSMAIN / AMATERSE algorithm used on z/OS. It is the PKZIP-assigned compression method 18 (IBM-TERSE).

Two compression modes are available:

   PACK  (NonSpack) - faster, moderate compression ratio
   SPACK             - slower, higher compression ratio

The HDRTYP parameter selects the header layout written ahead of the compressed stream:

   COMPAT (default) - 12-byte header, carries source-data DCB info
                      (record format, record length, optional z/OS
                      flags/blockSize/ratio metadata)
   NATIVE           - 4-byte header, PACK only, no DCB metadata
z/OS DCB METADATA (Compat header only)

The Compat header has two optional fields that describe the data as it existed on z/OS before compression. When writing from a non-MVS platform these fields are zero (non-MVS default). If ISHOST is set the compressor writes the MVS-origin flag (flags byte bit 0x04) and can populate the RATIO field:

   ISHOST   - set the Compat flags-byte bit 0x04 (MVS-origin marker)
   RATIO=n  - z/OS ratio byte (0..255); requires ISHOST

The block size stored in the Compat header is computed automatically from the record length (largest multiple of the physical record length that fits in the 16-bit Compat field). Manual override is available via the CNV.TRS() converter entry but not from COMPRESS.TERSE().

BEHAVIOR INSIDE A ZIP ARCHIVE

When TERSE compression is selected as the algorithm for a PKZIP archive (CNV.ZIP(ALGO=TERSE)), the PKZIP member is written with compression mode 18. The member payload is a naked TERSE stream (no additional wrapper) and the PKZIP local-file-header carries the ISO-ZIP version-needed value 4.6 to signal the use of method 18.

EXTRACTION COMPATIBILITY

PKZIP method 18 is a z/OS-centric format. Widely available desktop unzip tools (InfoZIP unzip, 7-Zip, WinZip on non-z/OS platforms) do not generally support method 18. Extraction of method-18 members is supported by:

  - FL5 itself (automatic on read)
  - z/OS AMATERSE (after the PKZIP wrapper is stripped manually)

For cross-platform transport of TERSE data, using CNV.TRS() (with the raw TERSE stream stored as method 0 = COPY inside any container) rather than CNV.ZIP(ALGO=TERSE) is often more convenient, because the TERSE bytes end up in the archive unchanged and a recipient can feed them directly to AMATERSE UNPACK.

Arguments