Previous Topic: Grouping StatementNext Topic: Editing Generated DDDL Statements


Using the Grouping Statement

Use to identify synonyms and nonunique file or record names

Use the grouping statement to identify synonymous and nonunique file or record names to the DDDL Generator:

Example 1

Five programs (PROG-1, PROG-2, PROG-3, PROG-4, PROG-5) are being processed. All five programs access files named MASTER. The name MASTER refers to one file for PROG-1 and PROG-2, to a second files for PROG-3 and PROG-4, and to a third file for PROG-5. The following grouping statements ensure that ADD statements will be generated for each of the three unique files:

FILE-GROUPING MASTER IN PROG-1 IN PROG-2
FILE-GROUPING MASTER IN PROG-3 IN PROG-4

Note that PROG-5 in not mentioned in these statements; when the DDDL Generator encounters the file name MASTER in PROG-5, it will treat the file as one of the group of all unqualified (that is, not explicitly mentioned in a grouping statement) files named MASTER and automatically generate an ADD statement.

Assuming that the data usage files are input in the order PROG-1 through PROG-5, the DDDL Generator generates the statements shown below. Note that SYNONYM clauses are not generated because all files have the same name.

(Under PROG-1)    ADD FILE MASTER...
(Under PROG-2)    (No statements)
(Under PROG-3)    ADD FILE MASTER...
(Under PROG-4)    (No statements)
(Under PROG-5)    ADD FILE MASTER...

The three ADD statements that use the file name MASTER can be edited to assure that the three distinct entities are entered into the dictionary. The statement can be distinguished from one another by using different version numbers or by changing the name MASTER for two of the three files.

Example 2

The file name SUM-FILE is used in five programs, PROG-1 through PROG-5. The name SUM-FILE refers to the same file in all five programs but the record description for the file is different in PROG-5. The following grouping statement makes the distinction:

FILE-GROUPING SUM-FILE IN PROG-5

Assuming that the data usage files are input in the order PROG-1 through PROG-5, the DDDL Generator generates the statements shown below:

(Under PROG-1)    ADD FILE SUM-FILE...
(Under PROG-2)    (No statements)
(Under PROG-3)    (No statements)
(Under PROG-4)    (No statements)
(Under PROG-5)    ADD FILE SUM-FILE...

These statements can then be edited (that is, versions added or file names changed) to assure that both entities will be added to the dictionary.

Example 3

The file names SUM-FILE in PROG-1 and SUMMARY-IN in PROG-2 both refer to the same file. Each file name has its own record descriptions. The following statement expresses the proper grouping:

FILE-GROUPING SUM FILE IN PROG-1 SUMMARY-IN IN PROG-2

Assuming that the data usage files are input in the order PROG-1, PROG-2, the DDDL Generator generates the statements shown below:

(Under PROG-1)        ADD FILE SUM-FILE...
                          FILE NAME SYNONYM IS SUMMARY-IN
(Under PROG-2)        ADD FILE SUMMARY-IN...
                          FILE NAME SYNONYM IS SUM-FILE

Because a single name cannot be both the primary entity-occurrence name and a synonym, these statements must be edited to designate one name as the primary name and all other names for the file as synonyms. For a complete discussion of synonym usage, see IDD User Guide.

Example 4

One file is named differently in four different programs. The file is named ABC in PROG-1, DEF in PROG-2, GHI in PROG-3, and JKL in PROG-4. The following grouping statement describes this situation:

FILE-GROUPING ABC IN PROG-1 DEF IN PROG-2 GHI IN PROG-3 JKL IN PROG-4

Assuming that the data usage files are input in the order PROG-1 through PROG-4, the DDDL Generator generates the following statements:

(Under PROG-1)   ADD FILE ABC...
                     FILE NAME SYNONYM IS DEF
                     FILE NAME SYNONYM IS GHI
                     FILE NAME SYNONYM IS JKL.
(Under PROG-2)   ADD FILE DEF...
                     FILE NAME SYNONYM IS ABC
                     FILE NAME SYNONYM IS GHI
                     FILE NAME SYNONYM IS JKL.
(Under PROG-3)   ADD FILE GHI...
                     FILE NAME SYNONYM IS ABC
                     FILE NAME SYNONYM IS DEF
                     FILE NAME SYNONYM IS JKL.
(Under PROG-4)   ADD FILE JKL...
                     FILE NAME SYNONYM IS ABC
                     FILE NAME SYNONYM IS DEF
                     FILE NAME SYNONYM IS GHI.

These statements must be edited to establish one primary name for the file and to designate all other names for the file as synonyms.