#### TABLE

#### Synopsis

    HELP:   Format table elements (tags, attributes, data, ...) to data blocks
    TYPE:   OBJECT
    SYNTAX: TABLE(FORMAT=ORG/FIX/LFD/DLM/VAR/CSV/TVD/XML,DEFAULTS(),ROW[()...],BUFSIZ=num,INICNT=num,PATH/ROOT='str')

#### Description

The object "format table" is used to describe the structure of the table rows to be written. A table can be in various formats (FB, VB, CSV,

###### ).

The table to be written can specified via row specifications that describe the columns of each row. A pre-defined output format can be used, together with some default settings, to reduce the number of parameters you need to specify for each column or to modify the behavior of the formats (e.g. change the CCSID, set delimiters, etc.).

If no row specification is provided a default format, CCSID, record delimiter and other default values can be set depending on the format. These defaults are used to convert the tables based on the row specification in the internal table header. If no output format is defined, then the original table is written as close to the original as possible depending on the remaining default values.

Row specifications allow to re-order or omit columns of the input table by using the original columns' names in the column specifications for the output table. An input column can also be written to multiple output columns, e.g. for obtaining different data formats of the same column.

The table name is used to assign a row specification to a table in the list. If a read table's name does not match a row specification, an error will occur. More row specifications can be defined than required, but for each input table format, there must be a matching row specification. If you don't want output for one of the tables in the list (i.e. delete a table, then don't provide any column specification. A row specification without columns will not print any column, resulting in the table not being written at all.

If the FLAM element list does not contain table header elements (which is only possible if an application uses the element interface to write an element list), then all row specifications are in charge and the first one that fits is used. In this case, it makes sense to use only one matching row specification.

By default a headline is written, if all columns supports headlines. For example, this is the case if all columns are of type CSV. Headlines can be deactivated through the default settings.

When the output is written as records: If all columns are defined as fixed-length, the sum of all column lengths will be the record length and the default record format is set to FB except a delimiter was defined at the end of the record (last column). If the maximum length is set for all variable length columns, then the sum is used as default record length for a VB dataset.

Table formatting supports many powerful features which can be accessed with the parameters below.

#### Arguments

- `NUMBER: BUFSIZ=num - Initial buffer size for preallocation [65536]`
- `NUMBER: INICNT=num - Initial amount of records for preallocation [128]`
- `STRING: PATH/ROOT='str' - Define path to table (root) in a structured format (prefix for higher level)`