STYLE

Synopsis

HELP:   CSV output formatting settings
TYPE:   OBJECT
SYNTAX: STYLE(CCSID='str'/DEFAULT/ASCII/EBCDIC/SYSTEM/LOCAL,SEPCHR=COMMA/COLON/SEMICOLON/TABULATOR/BLANK,FLDCHR=num/QUOTATION/APOSTROPHE/GRAVEACCENT/PARENTHESES/RBRACKETS/SBRACKETS/BRACES/CBRACKETS/ABRACKETS,FLDMTD=ALWAYS/IFREQ/NONE,RECDLM=HOST/BIN/TXT/NL/USS/LF/UNIX/CR/OLDMAC/CRLF/WINDOWS/DLM/SYSTEM,NOHDLN,NOESCP,NOCHECK/NOCHK,COLPATH=FULL/LEAF,COLSEP=UNDERSCORE/DOT/HYPHEN/NONE,TRIM=NONE/TRAILING/LEADING/BOTH,FILLER=COLUMN/ALIGN/SKIP,FRASEP=SYSTEM/PERIOD/COMMA/APOSTROPHE,ENCODE=OFF/BASE16/BASE32/BASE64,SIGMOD=IFNEGATIVE/SPACEIFPOSITIVE/PLUSIFPOSITIVE,FRADIG=num,FROUND=AWAYFROMZERO/NEAREST/TOWARDZERO/ERROR,FLTSIG,INTSIG,CASMOD=UPPER/LOWER/FOLD/SUPPER/SLOWER/USRTAB,CHRMOD=STOP/IGNORE/SUBSTITUTE/IDENTITY/TRANSLIT,SUBCHR[num/SYSTEM...],SYSTAB=ICONV,USRTAB='str'/NPAS/SEPA/DELA/DLAX,WITSPC=PRESERVE/REPLACE/COLLAPSE/REMOVE/TRAILING/LEADING/BOTH/NUMBER,ONEMAP,CMBFRM=NFD/NFC/AUTO/ON/OFF,ALIGN=num)

Description

Controls CSV formatting for the output archive. When no STYLE parameters are set, the output conforms to RFC 4180: comma field separator, CRLF record delimiters, and UTF-8 character encoding. Individual parameters override these defaults.

CSV structure

SEPCHR sets the column separator character. The default is COMMA. Supported named values: COMMA, SEMICOLON, COLON, TABULATOR, BLANK. A custom codepoint may also be specified as a number.

FLDCHR sets the field enclosing character. The default is QUOTATION (double quotation mark, U+0022). Supported named values: QUOTATION, APOSTROPHE, GRAVEACCENT, RBRACKETS, SBRACKETS, CBRACKETS, ABRACKETS. A custom codepoint may also be specified as a number.

FLDMTD controls when field enclosing characters are added:

RECDLM selects the record delimiter appended after each CSV row. The default is CRLF (carriage return and line feed), matching the common convention for portable UTF-8 CSV files. Other supported values: LF (UNIX), CR (old Mac), TXT or SYSTEM (system-specific delimiter), HOST or BIN (no delimiter appended).

NOHDLN suppresses the CSV header line that names the columns. Set this switch when the consumer does not expect a header row.

NOESCP disables escaping of the field enclosing character within field values. By default, any occurrence of the enclosing character in a value is doubled. Disabling this may produce CSV output that is not RFC 4180 compliant.

NOCHECK disables data format validation during write. By default, field values are checked against the selected CSV style settings. Disable only if the checks produce false positives for valid data.

ALIGN sets a fixed column width for all fields in the CSV output. When set to a non-zero value, every field is padded with trailing spaces or truncated to exactly that width. Use this to produce fixed-width aligned CSV output where all values line up in columns. The default is 0 (variable width, standard CSV behaviour).

Character encoding and conversion

CCSID sets the target character encoding for CSV text output. Accepts any CCSID or encoding name supported by the character conversion module. The default is UTF-8.

CASMOD applies case conversion to string column values. See the CASMOD man page for the list of supported modes (NONE, UPPER, LOWER, etc.). The default is NONE (no case conversion).

CHRMOD controls how characters that cannot be converted to the target CCSID are handled. See the CHRMOD man page for supported modes such as STOP (default), SKIP, SUBSTITUTE. The default is STOP.

SUBCHR provides a substitution code point list (up to 8 entries) used when CHRMOD is set to SUBSTITUTE. See the SUBCHR man page for details on specifying substitution code points.

SYSTAB selects a pre-built system substitution table for character conversion. See the SYSTAB man page for available tables. The default is NONE (no system table).

USRTAB specifies a keyword or filename containing a user-defined character conversion table. See the USRTAB man page for the table format. The default is NONE.

WITSPC controls whitespace handling for string column values. See the WITSPC man page for supported modes (PRESERVE, TRIM, COLLAPSE, etc.). The default is PRESERVE.

ONEMAP suppresses re-substitution of already-substituted characters during character conversion. Set this switch to prevent characters that were already replaced by a substitution from being substituted a second time. The default is FALSE.

CMBFRM applies a Unicode normalization form to string column values. See the CMBFRM man page for the list of supported forms (NFC, NFD, NFKC, NFKD). The default is NONE (no normalization).

Number formatting

FRASEP controls the decimal separator character for floating-point column values. The default is PERIOD (.), which produces locale-independent CSV files conforming to RFC 4180. A COMMA decimal separator would conflict with the COMMA field separator and corrupt the CSV structure. Supported values: PERIOD, COMMA, APOSTROPHE, SYSTEM. SYSTEM uses the platform locale's decimal separator and is not recommended for portable CSV files.

ENCODE controls how raw binary columns (fields without a string type annotation) are represented in CSV output. The default is BASE16 (hexadecimal). Supported values: BASE16, BASE32, BASE64, and others supported by the encoding module.

SIGMOD controls whether and when a sign character is written for integer and floating-point values. The default is IFNEGATIVE, which writes a minus sign only for negative values. ALWAYS writes an explicit sign for all values; NONE suppresses the sign entirely.

FLTSIG forces an explicit positive sign (+) for floating-point values that are greater than or equal to zero. The sign is written regardless of SIGMOD when this switch is set. The default is FALSE.

INTSIG forces an explicit positive sign (+) for integer values that are greater than or equal to zero. The sign is written regardless of SIGMOD when this switch is set. The default is FALSE.

FRADIG sets the number of fractional digits (decimal places) for floating-point output. When not set (the default), the number of decimal places is determined by the value itself (shortest exact representation). When set, floating-point values are rounded or padded to exactly the specified number of decimal places. Setting FRADIG activates FROUND.

FROUND selects the rounding mode applied when FRADIG limits the number of decimal places. The default is TOWARDZERO. Supported values: TOWARDZERO, NEAREST, CEILING, FLOOR, HALFEVEN. Only effective when FRADIG is set.

Column naming

COLPATH controls how column names are derived from the COBOL copybook hierarchy. FULL (default) uses the full path from the root group to the leaf field; LEAF uses only the leaf field name.

COLSEP selects the separator inserted between path components in column names when COLPATH=FULL. The default is UNDERSCORE.

TRIM controls padding removal for PIC X and PIC A string columns. When set, trailing padding bytes (as defined by the source CCSID) are stripped from string values before writing. The default is NONE.

FILLER controls how COBOL FILLER fields are handled. COLUMN emits each FILLER as a binary column (default), ALIGN absorbs it into the preceding column for alignment, SKIP omits it from the output entirely.

Arguments