Data Definition Language (DDL) Reference Manual

DDL Compiler Commands
Data Definition Language (DDL) Reference Manual529431-004
9-28
COBOL
In Example 9-13 on page 9-28, the DDL compiler retrieves the record, CUSTOMER,
from the open dictionary, translates it to COBOL source code, and appends the source
code to the open COBOL file.
For the DDL definition of the CUSTOMER record, see the sample database schema in
Appendix B, Sample Schemas.
DDL Output (COBOL Code)
?SECTION NAME,TANDEM
01 NAME.
02 LAST-NAME PIC X(12).
02 FIRST-NAME PIC X(8).
02 MIDINIT PIC X(2).
Example 9-13. COBOL Command
DDL Input
28> DDL
!?DICT $data.sales
!?COBOL $data.sales.cobsrc
!?OUTPUT RECORD customer.
!EXIT
Run DDL compiler.
Open dictionary.
Append customer record to COBSRC.
DDL Output (COBOL Code)
?SECTION CUSTOMER,TANDEM
01 CUSTOMER.
02 CUSTNUM PIC X(4).
02 CUSTNAME.
03 LAST-NAME PIC X(12).
03 FIRST-NAME PIC X(8).
03 MIDINIT PIC XX.
02 CUSTADDR.
03 ADDRESS PIC X(22).
03 CITY PIC X(14).
03 STATE PIC X(2).
03 ZIP PIC 9(5).
Example 9-12. COBOL Command (page 2 of 2)