RECORD

Synopsis

HELP:   Write records to a file
TYPE:   OBJECT
SYNTAX: RECORD(NET.{},FILE='str'/STREAM/DUMMY,EMPTYFILE=INFO/WARNING/ERROR/DELETE,FALLOC(),REMOVE,REMAIN,APPEND,FLUSH,RECMODE=STOP/CUT/WRAP/SKIP,RECDELIM='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,LENFORMAT.{},PRNCONTROL=DETACH/RETAIN/ERASE/REPLACE,RPLFFD[=num],SUPPADDING,PADCHAR='bin'/BINARY-ZERO/ASCII-BLANK/EBCDIC-BLANK/UTF08-BLANK/UTF16BE-BLANK/UTF16LE-BLANK/UTF32BE-BLANK/UTF32LE-BLANK,NOSPANNED,CCSID='str'/DEFAULT/ASCII/EBCDIC/SYSTEM/LOCAL,CASE=UPPER/LOWER/FOLD/SUPPER/SLOWER/USRTAB,BOM,KEPBOM,CHRMODE=STOP/IGNORE/SUBSTITUTE/IDENTITY/TRANSLIT,SUBCHAR[num/SYSTEM...],SYSTABLE=ICONV,USRTABLE='str'/NPAS/SEPA/DELA/DLAX,ONEMAP,COMBINED=NFD/NFC/AUTO/ON/OFF,REPORTFILE='str'/STDOUT/STDERR,BLK2REC,REGEXP(),COMPRESS/CMP.{},ENCRYPT/ENC.{},ENCODE/COD.{},ARCHIVE/LIB.{},LANG='str',PLATFORM=WIN/UNX/ZOS/USS/VSE/BS2/MAC,OWNER='str',ENVID='str',HASH(),SIGNATURE.{},INDSIZ=num,INDCHR=SPACE/TABULATOR,NOCMNT,NOMKDIR,TABLE(),ATTRIB(),AVSCAN(),PREPROCESS[()...],POSTPROCESS/PSTPRO[()...])

Description

Write record formats the list of elements as records for host data set formats or to archive the dataset in a format like GZIP, ZIP, PGP or as a FLAMFILE on a local or remote system.

The following options are supported:

If a record is marked as text record, character conversion from UTF-8 to a defined CCSID is done.

The following options are supported for character conversion:

During record I/O, encryption and compression can be applied. When selecting output formats like GZIP, PGP or ZIP, records are converted to data blocks. By default, a record length field (L4X) is put in front of binary records. For text records, a text delimiter is add by default. You can also specify a binary delimiter or another kind of 4 byte length field. The default text record conversion to a data block is compatible with a text file on non-mainframe platforms.

If you chose to retain control characters, then all record attributes (slot number, ASA and MCC) are stored in front the a binary record. If text handling used, then ASA and machine control character are lost, except the print control at READ.RECORD() was retain, in which case character conversion does not make much sense.

The file attributes can only be stored in a FLAMFILE, GZIP or ZIP member header or if an ASCII armor header is used. If you create, for example, a BZIP2 or binary PGP file, then all the DCB parameter are lost. When reading the file back, a PS-VB dataset will be created by default. The combinations below produce an archive that allow restoring the host data set without losing meta data (except load module entry addresses of a PDS(E) load library):

read.record(...) write.record(... archive.fl4())
read.record(...) write.record(... archive.zip())
read.record(...) write.record(... comp.bzip() archive.zip())
read.record(...) write.record(... encr.pgp()  archive.zip())
read.record(...) write.record(... comp.gzip() encr.pgp())
read.record(...) write.record(... encr.pgp(armor()))
read.record(...) write.record(... comp.bzip() encode.armor())

This functionality uses a private extension field in GZIP, ZIP or ARMOR headers and a per-record length field in the data. You can also use a binary delimiter for variable length records. When archiving files with FLCL, you must read them with FLCL to restore the datasets correctly. To read such a file, the example below can be used:

read.record(file='infile' DECODE) write.record()

Write record supports different encoding schemes (e.g. Base64). By default, the encoding is done record by record. If you enforce block orientation for the encoding, the record boundaries are lost and the resulting blocks can wrapped to new records, if you define all the corresponding parameters accordingly. When writing archive formats, the encoding is done after all compression/encryption.

If the data to be written consists of table elements and the 'TABLE' object is not specified or with no further formatting (i.e. TABLE()), then the original record in system representation without header 'TABLE(FORMAT=ORG DEFAULTS(SYSTEM,NOHDLN))' is written. Character conversion is done on a per-element basis. There is no report file or BOM support if table formatting is used. Use the 'TABLE' object to reformat the table.

Arguments