Wednesday, February 17, 2010


What is a control break procedure ?
A control break procedure is used if records are in sequence by a control field and the number of records in each control field is variable.

Steps for a Control Break
1. Read the initial record.
Move the control field to a hold area in WORKING-AREA.
As long as the control field is equal to the hold area, execute the detail routine for the input record. This means : Add the appropriate amount to a control total, print the detail record and read the next record.
If the control field is not equal to the hold area :
Print the control total.
Initialize the control total field to zero.
Reinitialize the hold field with the new control field value if there are more records.
Process the detail record as in step 3.
Print headings on a new page if each control total is to appear on a separate page.
If required, after all records have been processed perform a control break to print the last control group.

Back to COBOL Index

1 comment:

Anonymous said...

What if I want to print the total count for every category on the last page, instead of printing them for every change in field?

What should I do?