SECONDARY_TABLE XFD directive

Some Database Connectors interfaces (including MSSQL Server) permit subordinate tables. When this is the case, you can use the SECONDARY_TABLE XFD directive to indicate that the next data item may be placed into a subordinate table if more than one table is necessary to accommodate the data.

Up to 26 subordinate tables can be created from a single record description. Each table name is based on the original table name, with a letter from A to Z appended. For example, if the original table were named "my-table", subsequent subordinate tables would be given these names:

When the run time system accesses the XFD, it makes an initial pass through the data, taking all eligible data items for which the SECONDARY_TABLE XFD directive is not specified.

SECONDARY_TABLE is ignored for certain data items. These include:

If the table size is not exceeded in the first pass, then, in a second pass, the run time system appends to the original table all items marked SECONDARY_TABLE that can be accommodated.

When the first table reaches a limit (either in total number of columns or total number of characters), that table is created, and a new table is begun. Items that did not fit into the previous table are placed into a subordinate table, in the order in which they are encountered.

The process repeats until all items have been accommodated.

It is permissible to place the SECONDARY_TABLE XFD directive just before a level 01 record definition. In this case, it applies to all fields underneath the level 01.

Syntax

$XFD SECONDARY_TABLE

Example

 $xfd secondary_table
  01  description      pic x(80).