COLUMN

Synopsis

HELP:   Description of columns in the row
TYPE:   OBJECT
SYNTAX: COLUMN/COL[(NAME='str',TYPE.{},PROCESS[{}...],FORMAT.{},MINLEN=num,MAXLEN/FIXLEN=num,PATH='str',ROOT='str',VALUE='str',INSERT[=POSSIBLE/REQUIRED/NOTALLOWED],VARFMT=PLENPTR/ALENPTR/PPTRLEN/APTRLEN/PFLGLENPTR/PPTRLENFLG/PCLNDLNCOLDAT/PFLGCLNDLNCOLDAT/AFLGCLNDLNCOLDAT,REGEXP(),SKIP)...]

Description

Describes how a table column is written to the output, the format of the column, which post-processing steps are run (e.g. encryption) and how the produced data is put together to build a row/record.

The value parameter allows specifying a default value for a column. If the column does not exist in the original, this default is used. With this mechanism, columns with constant values can be added. The parameter is a string and must represent the value depending on the column type:

You can control over the selection INSERT the error handling. If the INSERT parameter not defined and a default value is given, then INSERT will be set to POSSIBLE else to NOTALLOWED by default. You can enforce an error if the column present but INSERT is set to REQUIRED. You can additional disallow insertion if you define INSERT to NOTALLOWED. If you only provide the INSERT keyword this will assumed as POSSIBLE.

The neutral format of the data can be validated or manipulated using a regular expression.

A column specification supports many powerful features which can be accessed with the parameters below.

SKIP -- Omit Column from Write-Side Output

The SKIP switch instructs the write-side to omit this column entirely when assembling the output record. The column is not written regardless of the output format (CSV, binary, XML, or any other).

SKIP is designed to work with the read-side DRAIN switch. When DRAIN is active on the corresponding read-side column, that column is excluded from both the element list and the table header. The write-side column with SKIP will therefore have no matching entry in the table header; the write side silently skips it without requiring an element from the element list.

SKIP can also be used without DRAIN when the read side produces an element for the column but it should be suppressed in the output. In that case the element is produced normally on the read side but the write side does not emit it.

For delimited output formats (CSV, DLM), the first/last column flags for delimiter placement are automatically adjusted to the first and last non-SKIP column, so no leading or trailing separators are produced for skipped columns.

The main use case is FILLER bytes in COBOL record layouts. The BCSV COBOL compiler sets SKIP on FILLER columns automatically (together with read-side DRAIN) when STYLE.FILLER=SKIP is active.

Example (suppress a 4-byte FILLER gap):

write.text(file=out.csv table(format=CSV row(name=CUSTOMER col(name=ID) col(name=_filler_ skip) col(name=NAME))))

Arguments