#### CSV

#### Synopsis

    HELP:   Write a data field based on separators and optional enclosing characters (CSV - RCF4180)
    TYPE:   OBJECT
    SYNTAX: CSV(COLNAM='str',CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL,SEPCHR[num/COMMA/COLON/SEMICOLON/TABULATOR/BLANK...],FLDMTD=ALWAYS/IFREQ/NONE,FLDCHR=num/QUOTATION/APOSTROPHE/GRAVEACCENT/PARENTHESES/RBRACKETS/SBRACKETS/BRACES/CBRACKETS/ABRACKETS,RECDLM=HOST/BIN/TXT/NL/USS/LF/UNIX/CR/OLDMAC/CRLF/WINDOWS/DLM/SYSTEM,ALIGN=num,NOCHECK/NOCHEK/NOCHK,NOESCP)

#### Description

This object is used to write a column as one manifestation of columns in the CSV format. The field separator, field enclosing character and record delimiter can be configured as needed.

A special behavior is implemented for brackets. If one of the opening brackets "(<{[" is selected as field enclosing character, then the fields of the column start with the specified bracket and end with the corresponding closing bracket.

If the data field contains the field enclosing character, then this character is escaped by doubling the character.

An alignment can be used to pad each cell of a column with whitespace characters to make the sheet human readable.

#### Arguments

- `STRING: COLNAM='str' - Name of the column in the CSV header [COLUMN-NAME]`
- `NUMBER: CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL - Character set for the CSV column [SYSTEM]`
  - `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))`
- `NUMBER: SEPCHR[num/COMMA/COLON/SEMICOLON/TABULATOR/BLANK...] - Separator character as Unicode codepoint [COMMA]`
  - `COMMA - Comma separated (default)`
  - `COLON - Separated by colon (':')`
  - `SEMICOLON - Separated by semicolon (';')`
  - `TABULATOR - Separated by tabulator (x'0009')`
  - `BLANK - Separated by blank (x'0020')`
- `NUMBER: FLDMTD=ALWAYS/IFREQ/NONE - When to write field enclosing characters [ALWAYS]`
  - `ALWAYS - Use always field enclosing characters`
  - `IFREQ - Use field enclosing characters only if required`
  - `NONE - Don't use field enclosing characters`
- `NUMBER: FLDCHR=num/QUOTATION/APOSTROPHE/GRAVEACCENT/PARENTHESES/RBRACKETS/SBRACKETS/BRACES/CBRACKETS/ABRACKETS - Field enclosing character as Unicode codepoint [DQM]`
  - `QUOTATION - Quotation mark as enclosing character`
  - `APOSTROPHE - Apostrophe as enclosing character`
  - `GRAVEACCENT - Grave accent as enclosing character`
  - `PARENTHESES - Round brackets as enclosing character`
  - `RBRACKETS - Round brackets as enclosing character`
  - `SBRACKETS - Square brackets as enclosing character`
  - `BRACES - Curly brackets as enclosing character`
  - `CBRACKETS - Curly brackets as enclosing character`
  - `ABRACKETS - Angle brackets as enclosing character`
- `NUMBER: RECDLM=HOST/BIN/TXT/NL/USS/LF/UNIX/CR/OLDMAC/CRLF/WINDOWS/DLM/SYSTEM - Which record delimiter to use after each row [auto]`
  - `HOST - Adds no delimiter (HOST)`
  - `BIN - Adds no delimiter (HOST)`
  - `TXT - Adds the system specific delimiter (DEFAULT)`
  - `NL - Adds delimiter new line (USS)`
  - `USS - Adds delimiter for USS (new line)`
  - `LF - Adds delimiter line feed (UNIX)`
  - `UNIX - Adds delimiter for UNIX (line feed)`
  - `CR - Adds delimiter carriage return (MAC)`
  - `OLDMAC - Adds delimiter for old MACs (carriage return)`
  - `CRLF - Adds delimiter carriage return line feed (WIN)`
  - `WINDOWS - Adds delimiter for WINDOWS (carriage return line feed)`
  - `DLM - Adds the system specific delimiter (DEFAULT)`
  - `SYSTEM - Adds the system specific delimiter (DEFAULT)`
- `NUMBER: ALIGN=num - Align data to the next multiple of this value in bytes [1 (no alignment)]`
- `SWITCH: NOCHECK/NOCHEK/NOCHK - Don't check if field enclosing character is required [OFF]`
- `SWITCH: NOESCP - Don't escape field enclosing character in the data [OFF]`