Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

DECLARATIVES

Function

The DECLARATIVES subdivision is an optional portion of the Procedure Division. It contains a group of procedures, called declarative procedures, which are not executed within the normal sequence of statements in the Procedure Division but only when a particular condition occurs.

Declarative procedures are used for performing the following functions:

  • input/output label handling

  • handling of input/output errors

  • special Report Writer functions.

Format (General format in the Procedure Division)


PROCEDURE DIVISION [USING {data-name-1}... ].

DECLARATIVES.
  { section-name SECTION.
      USE statement.
 [paragraph-name. 
      [sentence]...]...}...
 END DECLARATIVES.]

  {section-name SECTION [segment-number].
  [paragraph-name.
      [sentence]...]...}...


Syntax rules

  1. Declarative procedures must be placed at the beginning of the Procedure Division, preceded by the keyword DECLARATIVES and followed by a period and a space. Declarative procedures are terminated by the keyword END DECLARATIVES, followed by a period and a space.

  2. As indicated in the general format of the Procedure Division, the DECLARATIVES subdivision must be divided into sections. These sections are called declarative sections. Each declarative section contains a group of related procedures, and is preceded by a section header, immediately followed by a USE statement with subsequent period and space.

  3. The USE statement defines the type of declarative procedures according to the three functions listed above. The formats of the USE statement are described in detail in  chapter "USE statement" and chapter "USE BEFORE REPORTING statement".

  4. The USE statement itself is never executed; rather, it defines the conditions for executing the declarative procedures specified in the associated section.