


The DECLARE SECTION defines an interface for the interchange of values between the database system and the program. All host variables and indicators to be used in SQL statements are made known to the precompiler in this interface.
The DECLARE SECTION begins with the SQL statement EXEC SQL BEGIN DECLARE SECTION END-EXEC and ends with EXEC SQL END DECLARE SECTION END-EXEC. This syntax can occur in the FILE SECTION, WORKING-STORAGE SECTION, or LINKAGE SECTION, even several times in each one.
The DECLARE SECTION may contain all data elements and records which are allowed in COBOL, as well as all format control statements. For the declaration of host variables, however, only the following clauses are permitted:
- OCCURS clause,
- PICTURE clause,
- SIGN clause,
- SYNCHRONIZED clause,
- USAGE clause,
- VALUE clause.
The way in which host variables can be declared by means of these clauses is described in the chapter 'Host Variables'.


