Control Break Processing

Slides:



Advertisements
Similar presentations
9-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Advertisements

Programming Logic and Design Fourth Edition, Introductory
Programming Logic and Design, Second Edition, Comprehensive
Chapter 5: Database Forms and Reports
Chapter 7: Control Breaks Programming Logic and Design, Third Edition Comprehensive.
Programming Logic and Design, Third Edition Comprehensive
7-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
14-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Programming Logic and Design Fourth Edition, Introductory
Programming Logic and Design Fourth Edition, Comprehensive
General Algorithms for Common Business Problems
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
COBOL for the 21st Century
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
15-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Structured COBOL Programming, Stern & Stern, 9th Edition PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured.
Structured COBOL Programming, Stern & Stern, 9th edition
4-1 Coding Complete COBOL Programs: The PROCEDURE DIVISION Chapter 4.
4-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
NextGen Trustee Department Disbursements This class will cover the various methods of handling department disbursements. Whether entering them manually.
12-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
12-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
Chapter 07 Control Breaks.
10- 1 Chapter 10. To familiarize you with  Main types of computer-generated reports  Techniques used for efficient printing of group reports and control.
10-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
4-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
12- 1 Chapter 12.  Single-Level OCCURS Clauses  Processing Data Stored in Array  Using OCCURS Clause for Table Handling  Use of SEARCH Statement 
Break Processing Please use speaker notes for additional information!
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Excel Chapters -5,6. Pivot Table  When you have a lot of data, it can sometimes be difficult to analyze all of the information in your worksheet.  PivotTables.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
File Handling and Control Break Logic. Objectives In this chapter, you will learn about: Computer files Writing a program that reads from and/or writes.
Indexed and Relative File Processing
6 Chapter 61 Looping Programming Logic and Design, Second Edition, Comprehensive 6.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 6 Looping.
13-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Sequential Files Chapter 13. Master Files Set of files used to store companies data in areas like payroll, inventory Set of files used to store companies.
Any Questions? Control Breaks Agenda Control Breaks –Also known as Reports with sub-totals.
General Algorithms for Common Business Problems Simple Program Design Third Edition A Step-by-Step Approach 10.
9-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
12- 1 Chapter 12.  Single-Level OCCURS Clauses  Processing Data Stored in Array  Using OCCURS Clause for Table Handling  Use of SEARCH Statement 
Programming Logic and Design Fourth Edition, Comprehensive Chapter 8 Arrays.
1 Chapter 9. To familiarize you with  Simple PERFORM  How PERFORM statements are used for iteration  Options available with PERFORM 2.
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
13- 1 Chapter 13.  Overview of Sequential File Processing  Sequential File Updating - Creating a New Master File  Validity Checking in Update Procedures.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Chapter 11: Sequential File Merging, Matching, and Updating Programming Logic and Design, Third Edition Comprehensive.
11 Chapter 111 Sequential File Merging, Matching, and Updating Programming Logic and Design, Second Edition, Comprehensive 11.
12-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Managing Revenue Chapter 2. PAGE REF #CHAPTER 2: Managing Revenue SLIDE # 2 Objectives Set up customer records in the Customer:Job list Record Sales Receipts.
Bank Reconciliation. Process of balancing your check book Compare your bank statement to your records in QuickBooks to ensure that bank shows what you.
Visual Basic - Break Processing
12-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Designing and Debugging Batch and Interactive COBOL Programs
Programming Logic and Design Fourth Edition, Comprehensive
An Introduction to Structured Program Design in COBOL
Structured COBOL Programming
Designing and Writing Control-Break Programs
Minor, Intermediate and Major Breaks
Chapter 14 Sorting and Merging.
Iteration: Beyond the Basic PERFORM
Iteration: Beyond the Basic PERFORM
CHAPTER 17 The Report Writer Module
ECE 352 Digital System Fundamentals
Presentation transcript:

Control Break Processing COBOL for the 21st Century 11th edition Stern, Stern & Ley John Wiley & Sons, Inc. Chapter 10 Control Break Processing

Chapter Objectives To familiarize you with Main types of computer-generated reports Techniques used for efficient printing of group reports and control totals Control break processing and control break printing

Chapter Contents Introduction to Control Break Processing Program Requirements for Control Break Processing Multiple-Level Control Breaks

Types of Reports Detail or Transaction Reports Exception 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

Control Break Processing Produces summary report using control fields to indicate when totals are to print Records with same value for control field grouped together in file Totals printed for each group of records with same control field value

Control Break Example Consider file of sales records, each with three fields: Salesperson's department number, salesperson's number, sales amount Department number is control field Records in sequence by control field All records for salespeople in Dept 01 followed by records for those in Dept 02, …

Sample Sales Input Data 01 12345 098855 01 12346 353700 01 12347 003499 02 12222 987700 02 12234 008777 Amt-Of-Sales-In SlsNo-In Dept-In

Control Break Example Report includes detail printing One line for each record with salesperson's amount of sales Report also includes summary lines or group printing Total line written for each department After all records for Dept 01 read and printed, total for Dept 01 printed Same is done for Dept 02, and so on

Control Break Sample Report Dept Salesperson No Amt of Sales 01 12345 $988.55 01 12346 $3,537.00 01 12347 $34.99 Total for Dept is $4,560.54 02 12222 $9,877.00 02 12234 $87.77 Total for Dept is $9,964.77

Control Break Example Records must be in sequence by control field (department number) Sales records for Dept 01 read in, printed, Dept total accumulated Continues until record read in with different Dept number Change in Dept triggers printing of Dept total for Dept 01

Single-Level Control Break Single-level means program has only one control field whose value triggers printing of totals Control break is change in control field value from one record to the next

Single-Level Control Break Many steps (initialization, heading routines) same as previous programs Detail routine must be modified to check for control breaks New module added to handle control break processing

Detecting a Control Break For first record read, move control field to hold area in WORKING-STORAGE If control field of subsequent records is same as hold area Perform detail processing If they are not equal, control break occurs Perform control break routine

Detail Processing When control field is equal to hold area Add amount to control total Print detail record (if desired) Read next record

Control Break Routine If control field of record read is not equal to hold area Print control total for previous group Initialize control total field to zero Reinitialize hold field with new control field value Perform detail processing as in previous step

Handling first record First record has no previous control field value for comparison Add field to use as "flag" to determine if record is first one processed (e.g., First-Record initialized to 'YES') When record read, if First-Record = 'YES' Save control field value in hold area Turn "off" flag by setting it to 'NO'

Forcing Final Control Break Totals printed when record with new control field is read Last group of records has no subsequent record to trigger printing Include statements in end of job routine to move final group total to output record and print it

Printing a Final Total May accumulate final total by Adding amount from each record to control group total and final total in detail routine Adding control group total to final total in control break routine Second method more efficient since additions made once for each group instead of once for each record

Multiple Level Control Breaks Suppose a sales record is created each time a salesperson makes a sale Each salesperson may have multiple sales records Report will include two levels of totals Total sales for each salesperson Total sales for each department

Multiple Level Control Breaks Two control fields: Dept-In and SlsNo-In Records sorted by major control field (Dept-In) Within department, sorted by minor control field (SlsNo-In)

Sample Sales Input Data Dept-In SlsNo-In Amt-Of-Trans-In 01 004 127.23 01 004 100.14 01 006 027.45 01 006 052.23 01 006 126.27 02 003 111.14 02 003 027.23 In sequence within Dept 01

Double-Level Control Break Two hold areas, one for each control field Check for control break on each If no change in Dept-In or SlsNo-In, just add Amt-Of-Trans-In to salesperson total If Dept-In changes, perform major control break routine If no change in Dept-In but SlsNo-In changes, perform minor control break routine

Major Control Break Routine Begins by forcing minor control break This processes last salesperson’s total for previous department Print department total Reinitialize department total to zero Save new Dept-In in hold area Print heading for new department

Minor Control Break Routine Print total for previous SlsNo-In Add salesperson total to department total Initialize salesperson total to zero Move new SlsNo-In to hold area

Chapter Summary Control break program may have any number of control fields All input records must be in sequence by minor control fields within intermediate control fields within major control fields Sort file before processing if records are not already in this order

Chapter Summary Control break routines Higher-level breaks force lower-level breaks Appropriate control total line printed Appropriate control total is initialized Appropriate control field is initialized