REC

Synopsis

HELP:   Convert a block (binary or text) of data into a list of records
TYPE:   OBJECT
SYNTAX: REC(METHOD=BIN/TXT/REC/WRP/LEN/L4I/L4X/B4I/B4X/S4I/S4X/HLI/HLX/HBI/HBX/HSI/HSX/DLM,CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL,RPLFFD[=num],RPLTAB/RPLHTB[=num],RPLVTB[=num],RPLBSP,RPLCTR=SPACE/SUBSTITUTE/DELETE,SUPTWS,NELDLM,PADCHR=num,RECLEN=num,BUFSIZ=num,INICNT=num,RECDLM='bin'/CR-ASCII/LF-ASCII/NL-ASCII/CRLF-ASCII/CR-EBCDIC/LF-EBCDIC/NL-EBCDIC/CRLF-EBCDIC/CR-UTF08/LF-UTF08/NL-UTF08/CRLF-UTF08/CR-UTF16BE/LF-UTF16BE/NL-UTF16BE/CRLF-UTF16BE/CR-UTF16LE/LF-UTF16LE/NL-UTF16LE/CRLF-UTF16LE/CR-UTF32BE/LF-UTF32BE/NL-UTF32BE/CRLF-UTF32BE/CR-UTF32LE/LF-UTF32LE/NL-UTF32LE/CRLF-UTF32LE,RSTDAT=RECORD/ERROR/IGNORE,SUPPAd,PRSATR=ASA/MCC/REL/RELASA/RELMCC,SKPTXT,SKPLEN,NETREC)

Description

The record converter can be used to convert data blocks with delimiters or on input with different record length formats into data lists with records. This conversion component uses the text and record formatting component and provides all its features.

Auto detection of 4 byte record length fields is attempted if no method is provided. If the data block contains no record length fields or the provided binary delimiter does not fit and the switch to skip text formatting is not enabled, then all capabilities of the text formatting component are used to form records.

When no explicit record length is supplied, the converter checks the input filename for a FIX-group record-length qualifier embedded anywhere in the filename base (excluding the directory path). The qualifier has the form [.]F<sfx><n>[.] where <sfx> is an optional one- to three-letter format suffix and <n> is a decimal integer in the range 1-65535. The qualifier is case-insensitive.

Supported suffixes and their per-record overhead (added to <n> to yield the physical record length):

 Qualifier  Overhead  Description
 --------   --------  -------------------------------------------
 F          0         plain fixed
 FB         0         fixed blocked
 FS         0         fixed spanned
 FE         0         fixed extended
 FK         0         fixed key-sequenced
 FL         0         fixed large
 FA         1         fixed with ASA print-control character
 FM         1         fixed with machine print-control character
 FBA        1         fixed blocked + ASA
 FBM        1         fixed blocked + MCC
 FBS        0         fixed blocked spanned
 FBSA       1         fixed blocked spanned + ASA
 FBSM       1         fixed blocked spanned + MCC
 FSA        1         fixed spanned + ASA
 FSM        1         fixed spanned + MCC
 FEA        1         fixed extended + ASA
 FEM        1         fixed extended + MCC
 FKA        1         fixed key-sequenced + ASA
 FKM        1         fixed key-sequenced + MCC
 FLA        1         fixed large + ASA
 FLM        1         fixed large + MCC
 FR         8         fixed RRDS (8-byte slot header)
 FRA        9         fixed RRDS + ASA
 FRM        9         fixed RRDS + MCC

Examples:

 MYDATA.FB80.bin    -> record length 80   (FB, overhead 0)
 FILE.FBA133.bin    -> record length 134  (FBA, 133 + 1 ASA byte)
 REC.FR88.dat       -> record length 96   (FR, 88 + 8 RRDS header)
 EBCDIC_F0256.bin   -> record length 256  (plain F)
 DS.F00065535       -> record length 65535 (plain F, last component)

The qualifier is parsed before any explicit record-length fallback, so it can be used as a lightweight substitute for specifying the RECLEN parameter on the command line. On mainframe systems (z/OS) the catalog DCB attributes take precedence over any filename qualifier.

This feature is available in all commands that use the record converter for binary fixed-record input, in particular the BCSV command.

The SKPTXT flag causes input blocks to be only converted to records if record length fields or binary delimiter are detected. This can be useful, for example, for reading ZIP archives containing record-oriented files. PKZIP stores record-oriented files with a 4 byte length field (length of the field itself not included) in front of the record data in little endian (L4X). Another example files stored with FILEDATA=RECORD (B4X) in USS. When reading such a file, the length fields must be interpreted to re-build the corresponding records. This conversion can be added after any I/O or other conversion step.

ZIP files, GZIP files and the ASCII armor header support storing custom attributes which is used to store file attributes like the length field format, binary delimiter of the records, whether ASA or machine control characters are present, etc. If the file is written using CNV.BLK(PUTATR), the record attributes (RRDS slot number, print control characters) are written in front of each record and a custom file attribute stores a flag to mark which record attributes are present in order to be able to later parse the records correctly automatically. Other file formats do not support custom attributes. Hence, it is not possible to store file attributes in, e.g., BZIP2 or binary PGP files. In these cases, the PRSATR (parse attributes) parameter must be set to the correct keyword in order to read the file correctly if it has been written with the PUTATR switch enabled. The keyword to choose depends on the original file format.

The NETREC switch is intended for platforms where the I/O layer delivers pre-individualized net records with per-record lengths already stored in the input length table (piLenTab). The primary use case is z/OS QSAM reading of RECFM=VB datasets: the operating system strips the external record descriptor word (RDW) and delivers individual logical records whose exact lengths are tracked by BIORIO in record-oriented mode. When NETREC is set and the input carries more than one pre-split record, CNV.REC uses the FmtBinRed+FmtBinWrt combination to pass the records through 1:1 without any length-prefix detection or stripping. This prevents the converter from incorrectly treating user-embedded IMS length fields (LL+ZZ) as a B4X record-length prefix. If the input arrives as a single raw block (as on open-world platforms reading B4X ZIP members), the condition is false and the normal format detection path applies regardless of the NETREC flag.

Arguments