#### RECORD

#### Synopsis

    HELP:   Read records from memory
    TYPE:   OBJECT
    SYNTAX: RECORD(PRNCONTROL=DETACH/RETAIN/ERASE/REPLACE,RECFORMAT=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,RECLENGTH=num,RECCOUNT=num,REGEXP(),DECODE[=NONE/ARCHIVE/DECOMP/RECORD/CMPDEC/ALWAYS],DECRYPT[{}...],FDECODE/COD.{},CCSID='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL,CHRMODE=STOP/IGNORE/SUBSTITUTE/IDENTITY/TRANSLIT,SKIPEQUAL,USRTABLE='str'/NPAS/SEPA/DELA/DLAX,ONEMAP,COMBINED=NFD/NFC/AUTO/ON/OFF,BOM,KEEPBOM,TABLE(),AVSCAN())

#### Description

Format record converts records into memory. If a record is text data, this can be signaled this by setting the correct CCSID, which will result in character set conversion from the provided CCSID to UTF-8 for each record. If no CCSID is provided, the record is treated as binary data (no conversion).

Format record supports:

- Tables if the table object is specified
- Decoding, decryption and decompressing
- Character conversion if required

If the table object is used, then no explicit character conversion is performed. The character conversion settings are used as defaults for table formatting. The table formatting allows, for example, to read a fixed-length structure (copybook of an FB dataset) as record with EBCDIC strings, BCD numbers and so on, and write a CSV file in Latin-1.

When providing records with print control characters (1 byte ASA or MCC) and/or slot numbers (64 bit integer in local endianness), the corresponding record format must be specified. Additionally, a record length (with out control characters and space for slot numbers) can be specified, but this length is only relevant for file allocation. Print control character handling can be used to define how a ASA or MCC byte is processed by FLAM. For a MCC or ASA record, the control character must be the first of the record. For relative record datasets (VSAM-RRDS), the written record must start with an 8 byte unsigned integer in local endianness. Relativ records with print control characters (FIX-REL-ASA/MCC, FRA, FRM) must be prefixed with 9 bytes: 8 bytes for the slot number of the RRDS and 1 byte for ASA or MCC. The maximum length of a record is not limited and must be checked by the application. If ASA/MCC or REL are used, the minimum length of the provided record must be 1, 8 or 9 depending on the record format.

#### Arguments

- `NUMBER: RECFORMAT=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 operation [catalog/VAR]`
  - `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: RECLENGTH=num - Maximum record length for read operation [catalog/512]`
- `NUMBER: RECCOUNT=num - Amount of records handled in one read operation [catalog/128]`
- `NUMBER: DECODE=NONE/ARCHIVE/DECOMP/RECORD/CMPDEC/ALWAYS - Decode encoded, encrypted or compressed data [0=NONE]`
  - `NONE - No automated decoding`
  - `ARCHIVE - Transparently read archives`
  - `DECOMP - Decryption and decompression of encrypted and/or compressed data`
  - `RECORD - Decode record length fields or delimiter (is default) after decompression`
  - `CMPDEC - Additional base decoding after decompression, before formatting`
  - `ALWAYS - Always decode encoded data (causes the same as CMPDEC)`
- `SWITCH: SKIPEQUAL - Skip conversion if formats are equal (e.g. UTF-8 to UTF-8)`
- `SWITCH: KEEPBOM - Keep byte order mark for faster conversion`