#### FLAM4

#### Synopsis

    HELP:   Write records to a FLAM4FILE
    TYPE:   OBJECT
    SYNTAX: FLAM4(NET.{},FILE='str',MEMBER='str',REMOVE,REMAIN,APPEND,NOPATH,SPACE(),CMPMODE=CX7/CX8/VR8/ADC/NDC,ENCMODE=OFF/AES/FLAMENC,SPLIT.{},CLIMIT=num,ORGANIZATION=SEQ/PS/EDS/ESDS/KDS/KSDS/RDS/RRDS/LDS,RECFORMAT=VAR/FIX/UND/TXT/DLM/VB/FB/V2B-XBE/V4B-XBE/V4A-ICL/V4E-ICL/V2B-ILE/V2B-IBE/V4B-IBE,RECLENGTH=num,ORGLENGTH=num,KEYPOSITION=num,KEYLENGTH=num,COMMENT='str',PASSWORD/CRYPTOKEY='bin'/DEFAULT,KMLIBRARY='str',KMFUNCTION='str',KMPARAMETER='bin',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,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[()...],LARGER,BLK2REC)

#### Description

Writing with FLAM4 formats a list of elements into records and writes these records to a FLAMFILE of version 4 or older. If such a record is marked as text, a character set conversion from UTF-8 to the provided CCSID is done. If data elements are large blocks, then the result of the conversion is wrapped into records of the provided length or the default fixed length of 32,752 bytes.

During character conversion, the following options are supported:

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

For the FLAMFILE archive, the following options are supported:

- Definition of record format and length for the FLAMFILE
- Definition of compression and encryption mode
- Correct ASA and machine print control character handling
- Pass phrase based or FKME based encryption technology
- If no FKME encryption is used, a comment can be stored

The default member name is the name of the original file from the read operation. You can change this by defining a mapping rule for the member name. The block mode is always set to blocked, which means no unblocked FLAMFILEs can be generated. All the original file attributes are set to the right values in the file header automatically. User I/O as well as pre- and post- processing exits are not supported. If these features are really required, the extended variant (XCNV/XDCO) of this command should be used.

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

- `STRING: FILE='str' - Name/URL of the FLAMFILE to write [''==stdout]`
- `STRING: MEMBER='str' - Name of the member stored in the FLAMFILE header`
- `SWITCH: REMAIN - Remain existing files (don't overwrite) [FALSE]`
- `SWITCH: APPEND - Append the member to this FLAMFILE (not useful with encryption) [FALSE]`
- `SWITCH: NOPATH - Exclude directory path of the original file in the compressed data [FALSE]`
- `NUMBER: CMPMODE=CX7/CX8/VR8/ADC/NDC - Compression mode [ADC]`
  - `CX7 - Compression encoding as printable characters`
  - `CX8 - Compression encoding as binary data`
  - `VR8 - Enhanced compression encoding as binary data`
  - `ADC - Advanced Data Compression`
  - `NDC - No data compression`
- `NUMBER: ENCMODE=OFF/AES/FLAMENC - Encryption mode [NONE]`
  - `OFF - Disable encryption`
  - `AES - AES encryption`
  - `FLAMENC - FLAM encryption`
- `NUMBER: CLIMIT=num - Minimum compression in per cent (0 no Limit)[0]`
- `NUMBER: ORGANIZATION=SEQ/PS/EDS/ESDS/KDS/KSDS/RDS/RRDS/LDS - Organization of the FLAMFILE [SEQ]`
  - `SEQ - Sequential access [DEFAULT]`
  - `PS - Sequential access [DEFAULT]`
  - `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)`
  - `LDS - Linear data set (VSAM-LDS)`
- `NUMBER: RECFORMAT=VAR/FIX/UND/TXT/DLM/VB/FB/V2B-XBE/V4B-XBE/V4A-ICL/V4E-ICL/V2B-ILE/V2B-IBE/V4B-IBE - Record format for the FLAMFILE [FIX]`
  - `VAR - Variable`
  - `FIX - Fix`
  - `UND - Undefined`
  - `TXT - Text/Stream`
  - `DLM - Stream with special delimiter`
  - `VB - Variable blocked`
  - `FB - Fix blocked`
  - `V2B-XBE - Variable 2 byte length field without the length in big endian`
  - `V4B-XBE - Variable 4 byte length field without the length in big endian`
  - `V4A-ICL - Variable 4 byte length field in ASCII inclusive the length`
  - `V4E-ICL - Variable 4 byte length field in EBCDIC inclusive the length`
  - `V2B-ILE - Variable 2 byte length field inclusive the length in little endian`
  - `V2B-IBE - Variable 2 byte length field inclusive the length in big endian`
  - `V4B-IBE - Variable 4 byte length field inclusive the length in big endian`
- `NUMBER: RECLENGTH=num - Record length for the FLAMFILE [512]`
- `NUMBER: ORGLENGTH=num - Record length to wrap block oriented original data [32752]`
- `NUMBER: KEYPOSITION=num - Key position (>=1) for key sequential data sets [1]`
- `NUMBER: KEYLENGTH=num - Key length (>=1) for key sequential data sets [8]`
- `STRING: COMMENT='str' - Comment for the member in the FLAMFILE [internal use]`
- `STRING: PASSWORD/CRYPTOKEY='bin'/DEFAULT - Passphrase to encrypt the FLAMFILE ['']`
  - `DEFAULT - FLAM4 default password`
- `STRING: KMLIBRARY='str' - Library name for FKME ['']`
- `STRING: KMFUNCTION='str' - Function name of FKME ['']`
- `STRING: KMPARAMETER='bin' - Parameter for the call of FKME ['']`
- `SWITCH: KEPBOM - Keep byte order mark for faster conversion`
- `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]`
- `SWITCH: NOMKDIR - Don't create path if path not exists [FALSE]`
- `SWITCH: BLK2REC - Convert block with delimiter to records (including suppression of trailing whitespace`