Data Definition Language (DDL) Reference Manual

DDL Compiler Commands
Data Definition Language (DDL) Reference Manual529431-004
9-27
COBOL
For the data types that the DDL compiler generates for COBOL, see Tab l e C - 2 on
page C-3.
The compiler can translate DDL objects specified in an OUTPUT statement only if the
dictionary containing these structures is open.
Only one COBOL source code file can be open at a time. If you use the COBOL
command when you already have a COBOL source code file open, the DDL compiler
closes the current source code file before opening the new source code file.
The specified COBOL source code file can be an EDIT file, an unstructured file, or a
sequential device such as a terminal, a spooler, or a process. If the file exists but is not
one of these types, the DDL compiler issues an error message and does not open the
file.
If the COBOL source code file already exists and the exclamation point is omitted, the
DDL compiler appends the generated source code to the end of the file’s original
contents. The DDL compiler does not replace any existing structures.
Each DDL object translated to COBOL source code is written to the source code file in
a separate section with the same name as the DDL object it contains. You can
suppress the default section headings with the SETSECTION command.
The DDL compiler performs all of the syntax checks listed under the COBCHECK
command before writing source output. If it finds a syntax error, the DDL compiler
issues an error message and does not write the source output for the DDL object
statement with the error; it does write source output for the DDL object if only a
warning is issued.
In Example 9-12 on page 9-27, the DDL compiler opens a COBOL source code file,
COBSRC, on the subvolume $data.sales and adds the definition for name to that
file. COBOL does not recognize the UPSHIFT clause and is not included in the
COBOL source code.
Example 9-12. COBOL Command (page 1 of 2)
DDL Input
?COBOL $data.sales.cobsrc
DEF name.
02 last-name PIC X(12)
UPSHIFT.
02 first-name PIC X(8)
UPSHIFT.
02 midinit PIC X(2)
UPSHIFT.
END