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)

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.

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.

Arguments