The following rules apply to using host variables in a COBOL program:
This feature is useful for an INSERT with a VALUES clause that inserts multiple fields into a table using host variables.
All of the fields of the structure are passed to the Teradata Database, therefore the application must ensure that the structure elements match the number of elements specified in the SQL statement.
02 FIELD1 PIC X(20).
02 FIELD2 PIC S9(9) <comp>.
02 FIELD3 PIC X(6).
02 FIELD4 PIC S9(11)V99 COMP-3.
where <comp> is COMP-5 for MF COBOL and COMP for all other COBOL compilers.
This is one of several ways to declare a structure. Other valid forms are described in “Host Variable Declaration” on page 163.
The structure level can go deeper than the two levels shown, but the items, if individually referenced, must be uniquely identifiable with a qualification depth of no more than two.