HELP: IBM TRSMAIN/AMATERSE data compression technique (method 18) TYPE: OBJECT SYNTAX: TERSE(MODE=PACK/SPACK,HDRTYP=NATIVE/COMPAT,ISHOST,RATIO=num,SKIP)
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
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().
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.
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.
NUMBER: MODE=PACK/SPACK - Compression mode [PACK]
PACK - TRSMAIN/AMATERSE PACK compression mode (NonSpack)SPACK - TRSMAIN/AMATERSE SPACK compression mode (better ratio)NUMBER: HDRTYP=NATIVE/COMPAT - Header layout [COMPAT]
NATIVE - Native TERSE header (4 bytes, PACK only)COMPAT - AMATERSE compatibility header (12 bytes, carries DCB info)SWITCH: ISHOST - Mark as z/OS MVS origin - sets Compat flags bit 0x04 [FALSE]NUMBER: RATIO=num - z/OS ratio byte [0] (requires ISHOST)SWITCH: SKIP - Skip compression if no redundancy found [FALSE]