#### 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

- `STRING: NAME/FILE['str'/STREAM/DUMMY...] - Name/URL of file to read [STDIN]`
  - `STREAM - Read from stdin or write to stdout`
  - `DUMMY - Read EOF or write nothing`
- `NUMBER: RECMOD=STOP/CUT/WRAP/SKIP - Mode used to read records [STOP]`
  - `STOP - Stop if record too long`
  - `CUT - Cut if record too long`
  - `WRAP - Wrap if record too long`
  - `SKIP - Skip if record too long`
- `NUMBER: RPLFFD=num - Replace form feeds, filling rest of page with empty records assuming n lines per page [60]`
- `SWITCH: SUPPAD - Suppress trailing padding characters (useful for fixed records)`
- `STRING: PADCHR='bin'/BINARY-ZERO/ASCII-BLANK/EBCDIC-BLANK/UTF08-BLANK/UTF16BE-BLANK/UTF16LE-BLANK/UTF32BE-BLANK/UTF32LE-BLANK - Define padding character for suppression [automatic]`
  - `BINARY-ZERO - Padding with 0x00`
  - `ASCII-BLANK - Padding with 0x20`
  - `EBCDIC-BLANK - Padding with 0x40`
  - `UTF08-BLANK - Padding with 0x20`
  - `UTF16BE-BLANK - Padding with 0x0020`
  - `UTF16LE-BLANK - Padding with 0x2000`
  - `UTF32BE-BLANK - Padding with 0x00000020`
  - `UTF32LE-BLANK - Padding with 0x20000000`
- `NUMBER: FILORG=SEQ/PS/LIB/PDS/USS/EDS/ESDS/KDS/KSDS/RDS/RRDS - File organization [SEQ]`
  - `SEQ - Sequential data set [DEFAULT]`
  - `PS - Sequential data set [DEFAULT]`
  - `LIB - Library (ZOS-PDSE)`
  - `PDS - Partitioned data set (ZOS-PDS)`
  - `USS - UNIX files (path based)`
  - `EDS - Entry data set (VSAM-ESDS)`
  - `ESDS - Entry data set (VSAM-ESDS)`
  - `KDS - Keyed data set (VSAM-KSDS)`
  - `KSDS - Keyed data set (VSAM-KSDS)`
  - `RDS - Relative data set (VSAM-RRDS)`
  - `RRDS - Relative data set (VSAM-RRDS)`
- `NUMBER: 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 - Record format for read operations [NONE]`
  - `NONE - No format defined`
  - `BIN - Open - Binary (undefined) data (only the last record are shorter then record length)`
  - `TXT - Open - Text data with standard delimiter (result is a stripped variable length records)`
  - `TXT-ASA - Open - Text data with standard delimiter and ASA byte in front (result variable length records with ASA attribute)`
  - `TXT-MCC - Open - Text data with standard delimiter and MCC byte in front (result variable length records with MCC attribute)`
  - `DLM - Open - Records separated by a special delimiter with the result of variable length records`
  - `DLM-ASA - Open - ASA records separated by a special delimiter with the result of variable length records`
  - `DLM-MCC - Open - MCC records separated by a special delimiter with the result of variable length records`
  - `VAR - Open - Variable length record (if necessary define length format)`
  - `VAR-ASA - Open - Variable length record with ASA print control character (if necessary define length format)`
  - `VAR-MCC - Open - Variable length record with machine print control codes (if necessary define length format)`
  - `FIX - Open - Fixed-length record (file size = N * record length)`
  - `FIX-ASA - Open - Fixed-length record with ASA print control character (file size = N * (record length + 1))`
  - `FIX-MCC - Open - Fixed-length record with machine print control codes (file size = N * (record length + 1))`
  - `VAR-REL - Open - Variable relative record (if necessary define length format)`
  - `VAR-REL-ASA - Open - Variable relative record with ASA print control character (if necessary define length format)`
  - `VAR-REL-MCC - Open - Variable relative record with machine print control codes (if necessary define length format)`
  - `FIX-REL - Open - Fix relative record (file size = N * (record length + 8))`
  - `FIX-REL-ASA - Open - Fix relative record with ASA print control character (file size = N * (record length + 9))`
  - `FIX-REL-MCC - Open - Fix relative record with machine print control codes (file size = N * (record length + 9))`
  - `F - Host - Fixed-length, unblocked`
  - `FA - Host - Fixed-length, unblocked, ASA print control characters`
  - `FM - Host - Fixed-length, unblocked, machine print control codes`
  - `FS - Host - Fixed-length, standard`
  - `FSA - Host - Fixed-length, standard, ASA print control characters`
  - `FSM - Host - Fixed-length, standard, machine print control codes`
  - `FB - Host - Fixed-length, blocked`
  - `FBA - Host - Fixed-length, blocked, ASA print control characters`
  - `FBM - Host - Fixed-length, blocked, machine print control codes`
  - `FBS - Host - Fixed-length, blocked, standard`
  - `FBSA - Host - Fixed-length, blocked, standard, ASA print control characters`
  - `FBSM - Host - Fixed-length, blocked, standard, machine print control codes`
  - `FE - Host - Fixed-length, ESDS`
  - `FEA - Host - Fixed-length, ESDS, ASA print control characters`
  - `FEM - Host - Fixed-length, ESDS, machine print control codes`
  - `FK - Host - Fixed-length, KSDS`
  - `FKA - Host - Fixed-length, KSDS, ASA print control characters`
  - `FKM - Host - Fixed-length, KSDS, machine print control codes`
  - `FR - Host - Fixed-length, RRDS`
  - `FRA - Host - Fixed-length, RRDS, ASA print control characters`
  - `FRM - Host - Fixed-length, RRDS, machine print control codes`
  - `U - Host - Undefined-length`
  - `UA - Host - Undefined-length, ASA print control characters`
  - `UM - Host - Undefined-length, machine print control codes`
  - `V - Host - Variable`
  - `VA - Host - Variable, ASA print control characters`
  - `VM - Host - Variable, machine print control codes`
  - `VS - Host - Variable, spanned`
  - `VSA - Host - Variable, spanned, ASA print control characters`
  - `VSM - Host - Variable, spanned, machine print control codes`
  - `VB - Host - Variable, blocked`
  - `VBA - Host - Variable, blocked, ASA print control characters`
  - `VBM - Host - Variable, blocked, machine print control codes`
  - `VBS - Host - Variable, blocked, spanned`
  - `VBSA - Host - Variable, blocked, spanned, ASA print control characters`
  - `VBSM - Host - Variable, blocked, spanned, machine print control codes`
  - `VE - Host - Variable, ESDS`
  - `VEA - Host - Variable, ESDS, ASA print control characters`
  - `VEM - Host - Variable, ESDS, machine print control codes`
  - `VK - Host - Variable, KSDS`
  - `VKA - Host - Variable, KSDS, ASA print control characters`
  - `VKM - Host - Variable, KSDS, machine print control codes`
  - `VR - Host - Variable, RRDS`
  - `VRA - Host - Variable, RRDS, ASA print control characters`
  - `VRM - Host - Variable, RRDS, machine print control codes`
  - `ORG - Use original record format as default (like none)`
- `NUMBER: RECLEN=num - Record length for read operations [512]`
- `NUMBER: RECCNT=num - Amount of records handled in one read operation [4<128<1024]`
- `NUMBER: CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL - Character set [auto detection]`
  - `NONE - No character set defined`
  - `SYSTEM - SYSTEM (environment specific (on mainframe EBCDIC else ASCII))`
  - `ASCII - ASCII (mainly used in the for open system)`
  - `UCS1 - UCS-1 (for text formatting identical to ASCII < 64k)`
  - `UTF8 - UTF-8 (for text formatting identical to ASCII < 2M)`
  - `EBCDIC - EBCDIC (mainly used on IBM mainframe)`
  - `UCS2BE - UCS-2 Big Endian (multibyte character set < 64k)`
  - `UTF16BE - UTF-16 Big Endian (multibyte character set < 2M)`
  - `UCS2LE - UCS-2 Little Endian (multibyte character set < 64k)`
  - `UTF16LE - UTF-16 Little Endian (multibyte character set < 2M)`
  - `UCS4BE - UCS-4 Big Endian (multibyte character set < 64k)`
  - `UTF32BE - UTF-32 Big Endian (multibyte character set < 2M)`
  - `UCS4LE - UCS-4 Little Endian (multibyte character set < 64k)`
  - `UTF32LE - UTF-32 Little Endian (multibyte character set < 2M)`
  - `LOCAL - LOCAL (platform specific (on mainframe EBCDIC else ASCII))`
- `STRING: 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 - Delimiter used to define end of record`
  - `CR-ASCII - Delimiter: carriage return in ASCII (0x0D)`
  - `LF-ASCII - Delimiter: line feed in ASCII (0x0A)`
  - `NL-ASCII - Delimiter: new line in ASCII (0x85)`
  - `CRLF-ASCII - Delimiter: carriage return line feed in ASCII (0x0D0A)`
  - `CR-EBCDIC - Delimiter: carriage return in EBCDIC (0x0D)`
  - `LF-EBCDIC - Delimiter: line feed in EBCDIC (0x25)`
  - `NL-EBCDIC - Delimiter: new line in EBCDIC (0x15)`
  - `CRLF-EBCDIC - Delimiter: carriage return line feed in EBCDIC (0x0D25)`
  - `CR-UTF08 - Delimiter: carriage return in UTF-8 (0x0D)`
  - `LF-UTF08 - Delimiter: line feed in UTF-8 (0x0A)`
  - `NL-UTF08 - Delimiter: new line in UTF-8 (0xC285)`
  - `CRLF-UTF08 - Delimiter: carriage return line feed in UTF-8 (0x0D0A)`
  - `CR-UTF16BE - Delimiter: carriage return in UTF-16BE (0x000D)`
  - `LF-UTF16BE - Delimiter: line feed in UTF-16BE (0x000A)`
  - `NL-UTF16BE - Delimiter: new line in UTF-16BE (0x0085)`
  - `CRLF-UTF16BE - Delimiter: carriage return line feed in UTF-16BE (0x000D000A)`
  - `CR-UTF16LE - Delimiter: carriage return in UTF-16LE (0x0D00)`
  - `LF-UTF16LE - Delimiter: line feed in UTF-16LE (0x0A00)`
  - `NL-UTF16LE - Delimiter: new line in UTF-16LE (0x8500)`
  - `CRLF-UTF16LE - Delimiter: carriage return line feed in UTF-16LE (0x0D000A00)`
  - `CR-UTF32BE - Delimiter: carriage return in UTF-32BE (0x0000000D)`
  - `LF-UTF32BE - Delimiter: line feed in UTF-32BE (0x0000000A)`
  - `NL-UTF32BE - Delimiter: new line in UTF-32BE (0x00000085)`
  - `CRLF-UTF32BE - Delimiter: carriage return line feed in UTF-32BE (0x0000000D0000000A)`
  - `CR-UTF32LE - Delimiter: carriage return in UTF-32LE (0x0D000000)`
  - `LF-UTF32LE - Delimiter: line feed in UTF-32LE (0x0A000000)`
  - `NL-UTF32LE - Delimiter: new line in UTF-32LE (0x85000000)`
  - `CRLF-UTF32LE - Delimiter: carriage return line feed in UTF-32LE (0x0D0000000A000000)`
- `NUMBER: KEYPOS=num - Key position (>=1) for index/key sequential data sets [0=NONE]`
- `NUMBER: KEYLEN=num - Key length (>=1) for index/key sequential data sets [if KEYPOS>0 then 8]`
- `SWITCH: NOSPAN - Deactivate read of large spanned records from V(B)S datasets [FALSE]`