Signals the beginning of the DECLARE section.
Syntax:
>>---EXEC SQL---BEGIN DECLARE SECTION---END-EXEC---><
Example:
WORKING-STORAGE SECTION.
EXEC SQL BEGIN DECLARE SECTION END-EXEC
01 staff-id pic x(4).
01 last-name pic x(30).
EXEC SQL END DECLARE SECTION END-EXEC
Comments:
The BEGIN DECLARE SECTION statement can be included anywhere where COBOL permits variable declaration. Use END DECLARE SECTION to identify the end of a COBOL declaration section.
If data structures are defined within a declaration section, only the bottom-level items (with PIC clauses) can be used as host variables. Two exceptions are arrays specified in FETCH statements and record structures specified in SELECT INTO statements.