Declare section for host variables in COBOL embedded SQL applications
You must use an SQL
declare section must be used to identify host variable declarations.
The SQL declare section alerts the precompiler to any host variables
that can be referenced in subsequent SQL statements.
For example:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
77 dept pic s9(4) comp-5.
01 userid pic x(8).
01 passwd.
EXEC SQL END DECLARE SECTION END-EXEC.
The COBOL precompiler only recognizes a subset of valid COBOL declarations.