Designing and Writing - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Designing and Writing

Description:

Single-Level Control-Break Programs. Sequence of input records is important ... Print Ctrl-break Totals. Processing Logic ... control-break. Complex Programs ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 14
Provided by: winifr
Learn more at: http://www.nku.edu
Category:

less

Transcript and Presenter's Notes

Title: Designing and Writing


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
(No Transcript)
6
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

7
(No Transcript)
8
(No Transcript)
9
Processing Logic
  • When the Next Record does not match the Saved
    Control Number
  • Print the control-break total
  • Reset accumulators
  • Dont forget about page break processing
  • Two types of Print Lines
  • Detail Line
  • Control-break Total Line
  • At EOF, print last Control-break Total

10
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

11
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 ...

12
(No Transcript)
13
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com