#### RECORD

#### Synopsis

    HELP:   Write records to memory
    TYPE:   OBJECT
    SYNTAX: RECORD(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,PADCHAR='bin'/BINARY-ZERO/ASCII-BLANK/EBCDIC-BLANK/UTF08-BLANK/UTF16BE-BLANK/UTF16LE-BLANK/UTF32BE-BLANK/UTF32LE-BLANK,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.{},INDSIZ=num,INDCHR=SPACE/TABULATOR,NOCMNT,TABLE(),AVSCAN())

#### Description

Format record formats the list of elements in records. Each read operation writes only one record into memory.

Format record supports:

- Tables if the table object is specified
- Character conversion if required
- Compression, Encryption and Encoding
- Free definition of padding character for fixed length formats
- ASA and machine control character handling

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

Character conversion supports:

- Stop, ignore or substitution of invalid or incomplete character
- A free defined substitution character list
- Different system substitution / transliteration tables
- A user defined substitution table to change the system tables
- Case management (upper, lower, folding and special casing)
- Transliteration between subsets (mapping) and normalization
- BOM management and automatic detection of char sets
- Reporting of ignored or substituted characters
- Auto detection of charsets

If the input was read as XML, record formatting turns it into a human- readable XML document using pretty printing, i.e. with proper indentation. You can set the indentation character, the number of indentation characters printed for each indentation level and whether to suppress XML comments.

If the table object is used, then the corresponding method is set to 'record' as default and no explicit character conversion is done. 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 UTF-8.

To get padded fixed-length records or valid ASA or MCC bytes (FIX or VAR) in front of each record, you must specify the record format. For fixed- length formats the record length must be given. If no record length is provided, then 80 will be the default for fixed-length records. If you only set the record length, then fixed-length record format is assumed. If a fixed record format is used, the padding character can be set. If no padding character is set, binary zero is used for binary records or the whitespace character in the current character set is used for text records. A record is not truncated if it is longer than the provided record length. A relative record dataset format (VSAM-RRDS) can also be used. In this case, (FIX-REL(-ASA/MCC), FR(A/M)) the slot number is prefixed as 8 bytes integer in local endianness. If no slot number is known (records not read from an RRDS) then a sequential number (1,2,3,...) is generated.

#### 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]`
- `STRING: PADCHAR='bin'/BINARY-ZERO/ASCII-BLANK/EBCDIC-BLANK/UTF08-BLANK/UTF16BE-BLANK/UTF16LE-BLANK/UTF32BE-BLANK/UTF32LE-BLANK - Character to pad records to a fixed length [system] or used for empty variable length records [NONE]`
  - `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`
- `SWITCH: KEPBOM - Keep byte order mark for faster conversion`
- `SWITCH: BLK2REC - Convert block with delimiter to records (including suppression of trailing whitespace`
- `NUMBER: INDSIZ=num - Number of XML indentation characters per indentation level [2 (SPACE) or 1 (TAB)]`
- `NUMBER: INDCHR=SPACE/TABULATOR - Indentation character used to indent XML tags [SPACE]`
  - `SPACE - Use the space character as indentation character`
  - `TABULATOR - Use the tabulator character as indentation character`
- `SWITCH: NOCMNT - Do not write out XML comments [FALSE]`