1 / 13

Control Break Programs for Detail and Summary Reports

This chapter explores designing and writing control break programs for different types of reports such as detail, exception, and summary reports. Learn about single-level and multiple-level control break programs and the processing logic behind them. Includes examples and tips for complex programs.

bgarza
Télécharger la présentation

Control Break Programs for Detail and Summary Reports

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 10 Designing and Writing Control-Break Programs

  2. Types of Reports • Detail or Transaction Reports • Include one or more lines of output for each input record read • Exception Reports • Printout of individual records that meet (or fail to meet) certain criteria • Summary Reports • Summarizes rather than itemizes to provide more comprehensive information

  3. Topics • Single-Level Control-Break Programs • Sequence of input records is important • Data is sorted on the control-break field • Multiple-level Control-Break Programs • Input data is sorted on two or more fields • Control-Break is Similar to Page Breaks

  4. Control-Break Processing • The input data must be sorted • (Note: Chapter 13 covers detail of how your program can sort a file) • For now, we will assume the input file is already sorted (i.e., Sales Rep Number) • It could be sorted on two or three fields

  5. Processing Logic • Loop until EOF • Read record • If First-Record Set the Saved-Ctrl-Nbr • If Ctrl-Nbr not equal Saved-Ctrl-Nbr • Print Ctrl-break totals • Reset Ctrl-break totals • Set the Saved-Ctrl-Nbr • Process record • Print Ctrl-break Totals

  6. Processing Logic • When the “Next Record” does not match the Saved Control Number • Print the control-break total • Reset accumulators • Don’t forget about page break processing • Two types of Print Lines: • Detail Line • Control-break Total Line • At EOF, print last Control-break Total

  7. Complex Programs • Suppose there are two, or even three, control fields • The input file must be sorted on all fields (sorted in the proper sequence) • Sub-totals for each control-break

  8. Complex Programs • Input Data: • State, Branch, Sales Rep Number, other data • AR 01 001 ...AR 01 001 ...AR 01 002 ...AR 02 002 ...AR 03 001 ...AR 03 004 ...KY 02 002 ...KY 02 003 ...KY 02 003 ...KY 03 001 ...KY 03 002 ...KY 04 008 ...KY 04 010 ...

More Related