DDL Compiler Commands
Data Definition Language (DDL) Reference Manual — 426798-002
9- 97
SETSECTION Command
•
If SETSECTION is not specified or if SETSECTION is specified without
section-
name
, DDL precedes each DDL object in the open source-code files with a
?SECTION heading that uses the DDL object name as the section name.
•
The SETSECTION command affects only host-language source files (except TACL
source files) and DDL source files opened by the DDL command.
•
If you give a SETSECTION command with a name, and then open a host-
language source file, no SECTION commands are written to the file. The
SECTION command for the given name is not written because the file was not
open at the time. Also, the SETSECTION command inhibits any SECTION
commands for individual objects.
•
SETSECTION does not specify sections in the DDL source schema being
compiled. You use the SECTION command to specify section names in a source
schema in order to selectively compile source sections with the SOURCE
command.
SETSECTION Command Examples
The following example shows the use of the SETSECTION command to generate two
source-code sections: one for constants and one for definitions.
?SETSECTION constants
CONSTANT custnum-heading VALUE "Customer/Number".
CONSTANT mdy-date-display VALUE "mm/dd/yy".
CONSTANT phone-display VALUE "M(999) 999-9999".
•
•
•
?SETSECTION defs
DEF deliv-date PIC 9(6) DISPLAY mdy-date-display.
DEF custnum PIC 9(4) HEADING custnum-heading.
DEF custphone PIC 9(10) DISPLAY phone-display.
•
•
•
DDL generates the following COBOL source code from the preceding DDL source:
?Section CONSTANTS,Tandem
01 CUSTNUM-HEADING PIC X(15), VALUE IS "Customer/Number".
01 MDY-DATE-DISPLAY PIC X(11), VALUE IS "M99/99/99".
01 PHONE DISPLAY PIC X(17), VALUE IS "M(999) 999-9999".
•
•
•
?Section DEFS,Tandem
01 CUSTNUM PIC 9(4).
01 CUSTPHONE PIC 9(10).
01 DELIV-DATE PIC 9(6).
•
•
•