DDL Compiler Commands
Data Definition Language (DDL) Reference Manual — 426798-002
9- 27
COLUMNS Command
In the next example, the DDL compiler retrieves the record, CUSTOMER, from the
open dictionary, translates it into COBOL source code, and appends the source code
to the open COBOL file:
The record customer is stored in COBSRC as:
?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).
For the DDL definition of the CUSTOMER record, see the sample database schema in
Appendix B, Sample Schemas
.
COLUMNS Command
The COLUMNS command specifies how many character positions on input lines are
significant for DDL input. Each character position is a column, and you can specify
from 12 to 132 significant input columns.
num
specifies the number of significant one-byte character positions, or columns, for
input;
num
is an integer from 12 to 132.
COLUMNS Command Guidelines
The following points are guidelines for using the COLUMNS command:
•
If you do not specify the COLUMNS command, the default value is
132-character lines.
•
Changing the value of COLUMNS also changes the maximum string length
for DDL.
COLUMNS num
28> DDL
!?DICT $data.sales
!?COBOL $data.sales.cobsrc
!OUTPUT RECORD customer.
!EXIT
Run DDL compiler
Open dictionary
Open COBOL source file
Append customer record
to COBSRC
VST906.vsd