Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

CBL-CTR special register

CBL-CTR (Control Break Level Counter) is a special register that is defined automatically for each report described in the REPORT SECTION of the Data Division. The internal COBOL notation of this special register is PICTURE S999 USAGE COMPUTATIONAL.

The Report Writer and the program use this special register to pass information to each other concerning control breaks and the action to be taken when control breaks occur.

CBL-CTR can be used in connection with two different functions. Either, neither, or both of these functions may be used for a given report. For the sake of simplicity, the two functions are known as "function 1" and "function 2". The user program notifies the Report Writer which function it requires for a report. By a MOVE statement, the CBL-CTR register is assigned a value that symbolizes the requested function. Value and function interact as shown below:

Function requested

MOVE statement

Function 1

MOVE 1 TO CBL-CTR.

Function 2

MOVE 2 TO CBL-CTR.

Function 1 and 2

MOVE 3 TO CBL-CTR.

The corresponding MOVE statement must be executed after the INITIATE statement for the report but before the (chronologically) first GENERATE statement. This is the only time that the programmer is permitted to change the value of the CBL-CTR special register.

If two or more reports are defined in the REPORT SECTION, each reference to CBL-CTR must be qualified by the report-name.