REC

Synopsis

HELP:   Read a file record-oriented (mainly for mainframe world)
TYPE:   OBJECT
SYNTAX: REC(NET.{},NAME/FILE['str'/STREAM/DUMMY...],RECMOD=STOP/CUT/WRAP/SKIP,PRNCTR=DETACH/RETAIN/ERASE/REPLACE,RPLFFD[=num],SUPPAD,PADCHR='bin'/BINARY-ZERO/ASCII-BLANK/EBCDIC-BLANK/UTF08-BLANK/UTF16BE-BLANK/UTF16LE-BLANK/UTF32BE-BLANK/UTF32LE-BLANK,FILORG=SEQ/PS/LIB/PDS/USS/EDS/ESDS/KDS/KSDS/RDS/RRDS,BLKSIZ=num,RECFMT=NONE/BIN/TXT/TXT-ASA/TXT-MCC/DLM/DLM-ASA/DLM-MCC/VAR/VAR-ASA/VAR-MCC/FIX/FIX-ASA/FIX-MCC/VAR-REL/VAR-REL-ASA/VAR-REL-MCC/FIX-REL/FIX-REL-ASA/FIX-REL-MCC/F/FA/FM/FS/FSA/FSM/FB/FBA/FBM/FBS/FBSA/FBSM/FE/FEA/FEM/FK/FKA/FKM/FR/FRA/FRM/U/UA/UM/V/VA/VM/VS/VSA/VSM/VB/VBA/VBM/VBS/VBSA/VBSM/VE/VEA/VEM/VK/VKA/VKM/VR/VRA/VRM/ORG,RECLEN=num,RECCNT=num,LENFMT.{},CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL,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,KEYPOS=num,KEYLEN=num,SUBSYS(),REMOVE,NOSPAN,PREPRO[()...],POSTPRO/PSTPRO[()...])

Description

This object defines the record-oriented read operation for files. This method reads records from a data set. You can define the record length and the behavior (STOP/CUT/WRAP) if the record is longer than the defined record length. You can activate the suppression of padding characters and set the padding character. You can define the file organization, block size, record format and a lot of other parameters (see below).

The record length is always the real data length after all deductions. For example, for a FBA with a LRECL of 121, the record length of FLAM is 120 because the print control character is normally an attribute and not a part of the record.

On record oriented systems (mainly mainframes), a lot of these parameters are known from the catalog and need not be defined. On other platforms (Windows, Unix, ...), catalogs do not exist. On such systems, you must specify how the record-oriented file was written (record format, length format).

FLAM supports some record formats on mainframes which are not supported by the corresponding catalog system. For example, record formats with print control characters for VSAM data sets are supported by FLAM. If you know your data in a KSDS has a print control character in the first byte, you can choose the corresponding record format (VKA/VKM) to DETACH the print control character as attribute from the record.

The record I/O component also supports text files with delimiters. The record format text can be used to parse records form a delimiter-based text file, for which you can define the character set. It is also possible to parse binary data into records based on a custom delimiter. For this, the record format DLM can be used. The record format BIN simply wraps the data into records of the provided record length. The final record may be shorter. With the 'FIX' record format, the last record also has the provided record length. For variable length record formats (VAR) on non-record-oriented systems, the length format must be defined. All these formats are supported to transfer data between record-oriented and block-oriented systems.

For USS on z/OS the default length format for variable records conforms to SVC99 allocation with FILEDATA=RECORD. The record format TXT works like FILEDATA=TEXT if default settings used.

Attributes (length, slot number of RRDS, print control character) are stored in front of each record on non-record-oriented systems. Example: If you read a RRDS with print control characters (FRA) and you write this on UNIX as record format VRA to a file, the file format looks like this:

    LLLLnnnnnnnnCdddd..dddd
    LLLLnnnnnnnnCdddd..dddd
    LLLLnnnnnnnnCdddd..dddd
    ...
    ...
    ...
    LLLLnnnnnnnnCdddd..dddd
    LLLLnnnnnnnnCdddd..dddd

Where LLLL is the record length, nn...nn is the slot number C is the print control character and dd..dd is the record data. To read such a file on a UNIX system, the record format and length format (if you write with defaults, you can read with defaults) must be defined correctly.

Arguments