Previous Topic: Using the Grouping StatementNext Topic: Executing the DDDL Compiler


Editing Generated DDDL Statements

Edit before using as input to DDDL compiler

The output file of generated DDDL statements produced by running the DDDL Generator should be edited before being input to the DDDL compiler. This editing aids in maintaining control of the information entered into the dictionary.

Sample output

   ADD FILE CUSTOMER-FILE VERSION NEXT HIGHEST
       LABELS ARE OMITTED
       RECORD SIZE IS 104
       RECORDING MODE IS F
       FILE NAME SYNONYM IS CUSTFILE VERSION NEXT HIGHEST.

   ADD RECORD CUSTOMER VERSION NEXT HIGHEST
       LANGUAGE IS COBOL
       WITHIN FILE CUSTOMER-FILE VERSION HIGHEST
       RECORD NAME SYNONYM IS CUST VERSION NEXT HIGHEST.
           03 CUST-NUMBER              PIC X(10).
           03 CUST-NAME                PIC X(20).
           03 CUST-ADDRESS.
              05  CUST-ADDR1           PIC X(20).
              05  CUST-ADDR2.
                  06  CUST-CITY        PIC X(15).
                  06  CUST-ZIP-CODE    PIC X(5).
                  06  CUST-ZIPCODE REDEFINES CUST-ZIP-CODE
                                       PIC 9(5).
           03 CUST-CREDIT              PIC XXX.
              88 CUST-CREDIT-EXEC      VALUE 'AAA'.
              88 CUST-CREDIT-GOOD      VALUE '   '.
              88 CUST-CREDIT-POOR      VALUE 'XXX'.

           03 CUST-SALES-INFO.
              05  CUST-SALES-QTR       OCCURS 4.
                  06  CUST-NUM-SALES   PIC 9(5) COMP-3.
                  06  CUST-AMT-SALES   PIC S9(7) COMP-3.

           03 FILLER                   PIC XXX.

   ADD FILE ORDER-FILE VERSION NEXT HIGHEST
       LABELS ARE OMITTED
       RECORD SIZE IS 50
       RECORDING MODE IS F
       BLOCK SIZE IS 5000.

Editing functions

You should perform the following editing functions, as needed:

Add comments

Add comments to the descriptions of programs, files, and records to document the function and characteristics of each entity. Comments can be added easily and in an organized way at this point in the process of populating the dictionary.

Eliminate unnecessary entities

Delete the ADD statement for any entity that should not be a part of the dictionary. For example, report title records and report detail records used within a single program generally should not be defined in the dictionary. While important in the context of the specific program in which they are used, such records do not have global applications and tend to clutter the dictionary.

Reconcile nonunique names

If the DDDL output contains multiple ADD statements for the same name, editing may be necessary to ensure that the desired entities reach the dictionary when the ADD statements are processed by the DDDL compiler. Note the following considerations:

Condition

Description

If DEFAULT IS ON

The DDDL compiler will process the first ADD statement encountered for the nonunique name and change subsequent ADDs to MODIFYs. This means that only the description associated with the last ADD processed will be present in the dictionary.

If DEFAULT IS OFF

The DDDL compiler will process only the first ADD statement that refers to the nonunique name and will flag as erroneous subsequent ADD statements for that name. This means that only the description associated with the first ADD statement processed will be present in the dictionary.

DEFAULT IS ON/OFF can be specified with the SET OPTIONS statement.

Note: For more information about this option, see IDD DDDL Reference Guide.

In either case described above, the editing needed depends upon the objectives for the dictionary. Version clauses can be changed, ADD statements can be deleted or combined, or entity names can be changed (in the ADD statements and in the programs that refer to the names).

Note that running the DDDL Generator with the version statement VERSION NEXT HIGHEST and appropriate grouping statements assures that each entity occurrence with a duplicate name will be added to the dictionary when the generated statements are run through the DDDL compiler. Each repetition of the name will be associated with a different version number; the version number uniquely identifies the entity occurrence (for example, CUSTOMER record, version 1; CUSTOMER record, version 2; on so on). This technique should not be used to avoid the thoughtful evaluation of the generated statements and the editing necessary to develop a well organized dictionary.

Reconcile synonyms

Ideally, multiple ADD statements for synonymous file or record descriptions should be merged into a single ADD statement. A single description of a file or record should be entered in the dictionary. This means that all descriptions should be examined and combined. A single name should be chosen for the entity and associated record and or element names reconciled (that is, one name and description for the element customer name). Subsequently, all programs that use the entity must be changed to use the reconciled entity-occurrence name and to use any other associated reconciled names.

Alternatively, if record and element synonyms are desired, the generated DDDL statements can be edited to include ELEMENT NAME SYNONYM FOR RECORD NAME SYNONYM clauses.

Note: For additional information on element and record synonyms, see the IDD DDDL Reference Guide.

The reconciliation of synonyms is an important user responsibility in building an effective dictionary. Although the DDDL compiler accepts and processes multiple ADD statements that essentially define the same entity under different names, the practice of populating the dictionary with such synonymous entities is generally undesirable.