Host structures in COBOL
A host structure is a COBOL group that is referred to in an SQL statement.
As used here, the term host structure does not include an SQLIMSCA or SQIMSLDA.
The form of a host structure reference is identical to the form of a host variable reference. The reference :S1 is a host structure reference if S1 names a host structure.
A host structure can be referred to in any context where a list of host variables can be referenced. A host structure reference is equivalent to a reference to each of the host variables contained within the structure in the order which they are defined in the host language structure declaration. The nth variable of the indicator array is the indicator variable for the nth variable of the host structure.
For example, if V1, V2, and V3 are declared as the variables within the structure S1, the following two statements are equivalent:
EXEC SQLIMS FETCH CURSOR1 INTO :S1;
EXEC SQLIMS FETCH CURSOR1 INTO :V1, :V2, :V3;
In addition to structure references, individual host variables in COBOL can be referred to by qualified names. The qualified form is a host identifier followed by a period and another host identifier. The first host identifier must name a structure, and the second host identifier must name a host variable at the next level within that structure.
In COBOL, the syntax of host-variable is: