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.

Slides:



Advertisements
Similar presentations
Chapter 6 Computer Assisted Audit Tools and Techniques
Advertisements

Overview of Transaction Processing and Enterprise Resource Planning Systems Chapter 2.
MODULE 4 File and Folder Management. Creating file and folder A computer file is a resource for storing information, which is available to a computer.
Files  File organisation and usage A record is a group of logically related fields A file is a group of logically related records Files are used to store.
Chapter 15 Indexed Sequential Files. Disk File Organization File is collection of records Three major ways records stored or organized on disk - Sequential.
Chapter 10: Auditing the Expenditure Cycle
Data Model Examples: DFD’s and System Flowcharts
Databases and Processing Modes. Fundamental Data Storage Concepts and Definitions What is an entity? An entity is something about which information is.
Chapter 8 USING ACCOUNTING APPLICATIONS. Organization of Accounting Applications.
Chapter 6 AN INTRODUCTION TO FILES AND FILE PROCESSING Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering.
Overview of Transaction Processing and Enterprise Resource Planning Systems Chapter 2.
Chapter Lead Black Slide © 2001 Business & Information Systems 2/e.
CHAPTER 6 ELECTRONIC DATA PROCESSING SYSTEMS
VSAM KSDS and COBOL Department of Computer Science Northern Illinois University August 2005 Some of the illustrations are from VSAM: Access Method Services.
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)
Topics Covered: Data preparation Data preparation Data capturing Data capturing Data verification and validation Data verification and validation Data.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Lead Black Slide Powered by DeSiaMore1. 2 Chapter 10 Business Operations.
NextGen Trustee Department Disbursements This class will cover the various methods of handling department disbursements. Whether entering them manually.
Overview of Transaction Processing and Enterprise Resource Planning Systems Chapter 2.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
The DATA DIVISION Chapter 3. COBOL Data Organization Field - group of characters forming a meaningful unit or basic fact –Characters in a name or digits.
3-1 Chapter 3. To familiarize you with  Ways in which data is organized in COBOL  Rules for forming data-names  Defining input and output files in.
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
1 California State University, Fullerton Chapter 10 Business Operations.
Chapter 7 File I/O 1. File, Record & Field 2 The file is just a chunk of disk space set aside for data and given a name. The computer has no idea what.
Indexed and Relative File Processing
Edit Programs Please use speaker notes for additional information. Example: payedit.cbl payedit.cbl.
 2001 Prentice Hall Business Publishing, Accounting Information Systems, 8/E, Bodnar/Hopwood Chapter 10 Electronic Data Processing Systems.
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)
General Algorithms for Common Business Problems Simple Program Design Third Edition A Step-by-Step Approach 10.
SUPPLEMENTAL B An Overview of The General Ledger Architecture.
11- 1 Chapter 11.  Avoiding Logic Errors by Validating Input  What to Do If Input Errors Occur  Global Considerations in COBOL  When Data Should Be.
An Overview of The General Ledger Architecture.  Files are used to store data and processing instruction. The two types of files computer users use most.
 2013 Pearson Education, Inc. Publishing as Prentice Hall, AIS, 11/e, by Bodnar/Hopwood Chapter 7 7 – 1 Electronic Data Processing Systems.
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Working with Data Lists.
13- 1 Chapter 13.  Overview of Sequential File Processing  Sequential File Updating - Creating a New Master File  Validity Checking in Update Procedures.
Master File Update Processing. Objectives On completing this section you should be able to: w Distinguish between online processing and batch processing.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Chapter 9 Designing Databases 9.1.
The aim of producing a backup strategy is to make sure that a computer system can be returned to its original state if data has been lost or corrupted.
11- 1 Chapter 11.  Avoiding Logic Errors by Validating Input  What to Do If Input Errors Occur  Global Considerations in COBOL  When Data Should Be.
Chapter 11: Sequential File Merging, Matching, and Updating Programming Logic and Design, Third Edition Comprehensive.
Random update Please use speaker notes for additional information!
Presentation on Database management Submitted To: Prof: Rutvi Sarang Submitted By: Dharmishtha A. Baria Roll:No:1(sem-3)
Sequential Processing to Update a File Please use speaker notes for additional information!
Chapter 1 Page ref. Chapter 1 Company File Setup and Maintenance 1.
Topics Covered: File Components of file Components of file Terms used Terms used Types of business file Types of business file Operations on file Operations.
Company File Setup and Maintenance Chapter 6. PAGE REF #CHAPTER 6: Company File Setup and Maintenance SLIDE # 2 2 Objectives Use the EasyStep Interview.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
( ) 1 Chapter # 8 How Data is stored DATABASE.
 At the end of the class students should:  distinguish between data and information.  explain the characteristics and forms of Information Processing.
Electronic Data Processing Systems Chapter 6.
Transaction processing systems
The Impact of Information Technology on the Audit Process
The Impact of Information Technology on the Audit Process
Designing and Debugging Batch and Interactive COBOL Programs
Chapter 3 The DATA DIVISION.
Please use speaker notes for additional information!
Programming Logic and Design Fourth Edition, Comprehensive
Overview of Transaction Processing and Enterprise Resource Planning Systems Chapter 2.
Please use speaker notes for additional information!
Chapter 22, Part
CHAPTER 6 ELECTRONIC DATA PROCESSING SYSTEMS
2.8 – Payroll applications
Presentation transcript:

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 data in areas like payroll, inventory Usually processed by batch processing Usually processed by batch processing Typically stored on magnetic disk Typically stored on magnetic disk Disks can store billions of characters Disks can store billions of characters Disk drives read, write data quickly Disk drives read, write data quickly Disk records can be any size Disk records can be any size

Sequential Files Records always read in sequence Records always read in sequence Read first record, process it, then read second record, process it and so on Read first record, process it, then read second record, process it and so on Payroll records in order by employee number may be processed in sequence for updating or printing reports Payroll records in order by employee number may be processed in sequence for updating or printing reports

Sequential Files May be sorted into any sequence using any field in record May be sorted into any sequence using any field in record To distribute checks more easily, records may be sorted by department To distribute checks more easily, records may be sorted by department Sequential processing then used to print checks, reading first record, then second, etc. Sequential processing then used to print checks, reading first record, then second, etc.

Master File Procedures Typical procedures for sequential processing in batch mode are: Designing Master File Designing Master File Creating Master File Creating Master File Creating Transaction File Creating Transaction File Updating Master File Updating Master File Reporting from Master File Reporting from Master File

Designing a Master File Place key fields that uniquely identify record at beginning of record Place key fields that uniquely identify record at beginning of record If possible, choose numeric key fields If possible, choose numeric key fields Secondary fields after primary key fields Secondary fields after primary key fields Remaining fields appear in order of importance Remaining fields appear in order of importance

Designing a Master File Choose field size large enough to accommodate data stored in it Choose field size large enough to accommodate data stored in it Use coded fields where possible to save space Use coded fields where possible to save space Be sure all date fields include four-digit year Be sure all date fields include four-digit year

Creating a Master File Original master file data entered interactively, stored on disk file Original master file data entered interactively, stored on disk file Ensure data integrity by using data validation techniques to minimize risk or errors Ensure data integrity by using data validation techniques to minimize risk or errors Control listing or audit trail produced to show data stored in new master file and control totals Control listing or audit trail produced to show data stored in new master file and control totals

Creating a Transaction File Changes to master file made with separate procedure Changes to master file made with separate procedure Change records stored in file called transaction file Change records stored in file called transaction file

Updating a Master File Updating is process of making master file current Updating is process of making master file current Update master file by incorporating changes from transaction records Update master file by incorporating changes from transaction records

Reporting from a Master File Scheduled reports prepared on regular basis from data stored in master file Scheduled reports prepared on regular basis from data stored in master file Sales reports, customer bills, checks, etc. Sales reports, customer bills, checks, etc. Use detail, exception and group printing techniques Use detail, exception and group printing techniques On demand reports produced as need arises On demand reports produced as need arises May be in report form or displayed on screen May be in report form or displayed on screen

Sequential File Updating Two input files Input Master File (Old-Master) Input Master File (Old-Master) Current through previous updating period Current through previous updating period Does not contain changes since previous update Does not contain changes since previous update Input Transaction File (Trans-File) Input Transaction File (Trans-File) Contains changes since previous update to be applied to Old-Master Contains changes since previous update to be applied to Old-Master

Sequential File Updating Two output files Output Master File (New-Master) Output Master File (New-Master) Integrates data from Old-Master with all of changes from Trans-File Integrates data from Old-Master with all of changes from Trans-File Will become Old-Master for next update Will become Old-Master for next update Control Listing or Audit Trail Control Listing or Audit Trail Print file showing changes made to master file, errors during processing and control totals Print file showing changes made to master file, errors during processing and control totals

Sequential Master File Update Transaction File Updated Master File Master File Update Activity Report Sequential File Update

Ordering of Records Records in Old-Master and Trans-File must be in order by same key field Records in Old-Master and Trans-File must be in order by same key field Compare key fields to determine if given master record is to be updated Compare key fields to determine if given master record is to be updated

Master File 1223 ……… ……… ……… ……… ……… ……… ……… ……… ……….. ^z Transaction File 1235 ……………………..A 1273 ……………………..C 1456 ……………………..C 1543 ……………………..D 1678 ……………………..B 2910 ……………………..C 3006 ……………………..D 3098 ……………………..C 3099 ……………………..D ^z 1223 ………………………… 1235 ………………………… 1277 ………………………… 1456 ………………………… 2835 ………………………… 2910 ………………………… 3100 ………………………… 3143 ………………………… 4372 ………………………… ^z New Master File

Sequential Update Procedure Initially, record read from both Old-Master and Trans-File Initially, record read from both Old-Master and Trans-File Comparison of M-Acct-No and T-Acct-No determines next step Comparison of M-Acct-No and T-Acct-No determines next step

1) T-Acct-No = M-Acct-No Means transaction record exists with same account number as master record Means transaction record exists with same account number as master record Perform regular update, adding Trans-File amount to Old-Master amount, storing result in New-Master field Perform regular update, adding Trans-File amount to Old-Master amount, storing result in New-Master field Read next record from Trans-File Read next record from Trans-File

2) T-Acct-No > M-Acct-No Means master record exists for which there is no corresponding transaction record Means master record exists for which there is no corresponding transaction record Write record from Old-Master to New-Master as is, since no changes need to be made to it Write record from Old-Master to New-Master as is, since no changes need to be made to it Read next record from Old-Master Read next record from Old-Master

3) T-Acct-No < M-Acct-No Means transaction record exists for which there is no corresponding master record Means transaction record exists for which there is no corresponding master record Two ways to process this transaction Two ways to process this transaction Create record in New-Master file for this transaction Create record in New-Master file for this transaction May assume that T-Acct-No is invalid since no match found in Old-Master file and treat as error condition May assume that T-Acct-No is invalid since no match found in Old-Master file and treat as error condition

Use of HIGH-VALUES Refers to largest value in computer's collating sequence Refers to largest value in computer's collating sequence Used so all records from both Old-Master and Trans-File are processed Used so all records from both Old-Master and Trans-File are processed May reach end of Old-Master file before reaching end of Trans-File or vice versa May reach end of Old-Master file before reaching end of Trans-File or vice versa

Use of HIGH-VALUES When last record read from Old-Master, M- Acct-No set to HIGH-VALUES When last record read from Old-Master, M- Acct-No set to HIGH-VALUES For all remaining transaction records T-Acct-No < M-Acct-No For all remaining transaction records T-Acct-No < M-Acct-No Processed as new accounts and added to New- Master Processed as new accounts and added to New- Master

Use of HIGH-VALUES When last record read from Trans-File, T- Acct-No set to HIGH-VALUES When last record read from Trans-File, T- Acct-No set to HIGH-VALUES For all remaining Old-Master records T-Acct-No > M-Acct-No For all remaining Old-Master records T-Acct-No > M-Acct-No Old-Master records added to New-Master without changes Old-Master records added to New-Master without changes

Use of HIGH-VALUES Loop to process records ends only when both account numbers equal HIGH-VALUES Loop to process records ends only when both account numbers equal HIGH-VALUES May be used only with fields defined as alphanumeric May be used only with fields defined as alphanumeric Define account number fields with PIC of Xs even though fields contain numbers Define account number fields with PIC of Xs even though fields contain numbers

Validity Checking in Updating Code field may be added to each transaction record to indicate whether transaction is Code field may be added to each transaction record to indicate whether transaction is New account to be added New account to be added Update to existing account Update to existing account Deletion of existing account Deletion of existing account Comparison of keys and transaction code type enable program to detect other update errors Comparison of keys and transaction code type enable program to detect other update errors

Updating Master Disk in Place May read a master disk record, make changes directly to same record, and rewrite it or update it in place May read a master disk record, make changes directly to same record, and rewrite it or update it in place Only two files needed Only two files needed Master-FileOPEN as I-O Master-FileOPEN as I-O Trans-FileOPEN as INPUT Trans-FileOPEN as INPUT Use REWRITE statement to replace master disk record, currently in storage, that was accessed by preceding READ Use REWRITE statement to replace master disk record, currently in storage, that was accessed by preceding READ

Updating Master Disk in Place To delete a record, establish each record with an activity code field To delete a record, establish each record with an activity code field For example, Code-X = 1 if record is active, or 2 if record is inactive For example, Code-X = 1 if record is active, or 2 if record is inactive All master records initially active (1 in Code- X) All master records initially active (1 in Code- X) Master record deactivated by changing activity code to 2 Master record deactivated by changing activity code to 2

Updating Master Disk in Place New records cannot be added in sequence when file open for I-O New records cannot be added in sequence when file open for I-O Can add records at end of file by opening file in EXTEND mode Can add records at end of file by opening file in EXTEND mode OPEN EXTEND file-name Disk automatically positioned at end of file, immediately after last record Disk automatically positioned at end of file, immediately after last record Sort file after records added to arrange them in sequence Sort file after records added to arrange them in sequence