Previous Topic: WHERE Clause (Conditional Expressions)Next Topic: Entity-Type Syntax


DISPLAY/PUNCH Examples

Displaying a Single Entity Occurrence

The following four statements illustrate DISPLAY/PUNCH statements that request information about a single entity occurrence.

  1. IDD displays as comments the user-defined nests associated with the system PAYROLL.
    display system payroll
         with user defined nests
         as comments.
    *+   add
    *+   system name is payroll version is 1
    *+       'prerequisite system' is 'employee maintenance'
    *+       version 1
    *+       .
    
  2. SET OPTIONS establishes HISTORY as the default display option and AS COMMENTS as the output format.
    set options for session
         display with history as comments.
    
  3. IDD displays the definition of the CUSTOMER record with ELEMENT and PICTURE OVERRIDES specifications in addition to HISTORY.
    display record customer
         also with elements picture overrides.
    *+   add
    *+   record name is customer version is 1
    *+       date created is      mm/dd/yy
    *+       date last updated is mm/dd/yy
    *+       prepared by wmc
    *+       revised by wmc
    *+       .
    *+       record element is cust-name version 1 line is 000100
    *+       level number is 02
    *+       usage is display
    *+       .
    
  4. IDD displays the same definition without the PICTURE OVERRIDES option.
    display record customer
         without picture overrides.
    *+   add
    *+   record name is customer version is 1
    *+       date created is      mm/dd/yy
    *+       date last updated is mm/dd/yy
    *+       prepared by wmc
    *+       revised by wmc
    *+       record length is 119
    *+       record name synonym is customer version 1
    *+       .
    *+       record element is cust-name version 1
    *+       level number is 02
    *+       .
    

Displaying/Punching Multiple Entity Occurrences

The following example illustrates a DISPLAY/PUNCH statement that requests multiple entity occurrences. IDD displays the first five occurrences of the ELEMENT entity type; to submit the resulting ADD ELEMENT statements to the DDDL compiler, you must press ENTER.

display first 5 elements
     verb add
     as syntax.
   add element name is field-array version is 1 .
   add element name is emp-fname-09-ws version is 9 .
   add element name is emp-lname-09-ws version is 9 .
   add element name is emp-name-09-ws version is 9 .
   add element name is emp-info-09-ws version is 9 .

The following example illustrates a DISPLAY/PUNCH statement that requests multiple entity occurrences with ‘as syntax’ appended to each generated line. IDD displays the first five occurrences of the ELEMENT entity type.

display first 5 elements
     as syntax recursive.
   display element name is field-array version is 1 as syntax.
   display element name is emp-fname-09-ws version is 9 as syntax.
   display element name is emp-lname-09-ws version is 9  as syntax.
   display element name is emp-name-09-ws version is 9 as syntax.
   display element name is emp-info-09-ws version is 9 as syntax.

In the following example, IDD displays as comments all modules that contain the literal MOD- as part of the module name.

display all modules
     where name contains 'mod-'
     as comments.

In the following example, IDD punches all files to the module DEMO-PUNCH.

punch all files
     to module demo-punch
     as syntax.