Some RDBMSs such as Sybase permit subordinate tables. When this is the case, you can use the SECONDARY-TABLE 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, then subsequent subordinate tables would be given these names:
my-tableA
my-tableB
my-tableC
my-tableD
When the runtime accesses the data dictionary, it makes an initial pass through the data, taking all eligible data items for which the SECONDARY-TABLE directive is not specified.
SECONDARY-TABLE is ignored for certain data items. These include:
* any field that is part of a key
* any field that is an indicator for a WHEN directive
If the table size is not exceeded in the first pass, then, in a second pass, the runtime 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's permissible to place the SECONDARY-TABLE directive just before a level 01 record definition. In this case, it applies to all fields underneath the level 01.
Syntax
$XFD SECONDARY-TABLE
or
*(( XFD SECONDARY-TABLE ))
Example
$xfd secondary-table
01 description pic x(80).