DMSII Nested OCCURSThe following is an excerpt from a DMSII DASDL showing a GROUP with an OCCURS clause that contains an item with an OCCURS clause. This example helps to reinforce the previous examples of how DMSII GROUP and OCCURS are mapped to a relational database. SALES DATA SET
When this SALES data set is cloned into the relational database, it is mapped into the following three tables:
Table 1This table is named the same as the SALES DMSII data set. It contains the key item and all non-OCCURS data items. Because the GROUP has an OCCURS clause, none of the GROUP items are included in this table. Assuming there are five records in the DMSII data set, there are five rows in the resulting relational database table. sales (table name) This table is named the same as the SALES DMSII data set. It contains the key item and all non-OCCURS data items. Because the GROUP has an OCCURS clause, none of the GROUP items are included in this table. Assuming there are five records in the DMSII data set, there are five rows in the resulting relational database table. sales (table name) Table 2This table is named: datasetname + GROUP_OCCURS_name Assuming there are five records in the DMSII data set, there are 25 rows in this table. Note the addition of index1 to denote the occurrence number of the group. sales_sales_history (table name) product_code index1 total_units_sold Table 3This table is named: datasetname + OCCURSitemname Assuming there are five records in the DMSII data set, there are 300 rows in this table (12 occurrences of monthly_sales_amount for each of 5 occurrences of sales_history for each product code). In the table below, index1 is the subscript of the GROUP OCCURS (1–5) and index2 is the subscript of the monthly sales amount, with subscripts (1–12). In this example, the OCCURS level of the items MONTHLY-SALES-AMOUNT is 2, while the OCCURS level of the item SALES-HISTORY is 1. sales_monthly_sales_amount (table name) | ||
|