Some RDBMSs 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 16 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 "P" appended. For example, if the original table were named "my-table," subsequent subordinate tables would be given these names:
When the runtime accesses the XFD, 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:
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.
$XFD SECONDARY-TABLE
or
*(( XFD SECONDARY-TABLE ))
$xfd secondary-table 01 description pic x(80).