chapter 13 sequential file processing. master files set of files used to store companies data in...

23
Chapter 13 Sequential File Processing

Upload: cordelia-martin

Post on 28-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Chapter 13

Sequential File Processing

Page 2: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Master Files

• Set of files used to store companies data in areas like payroll, inventory

• Usually processed by batch processing

• Typically stored on magnetic disk– Disks can store billions of characters– Disk drives read, write data quickly– Disk records can be any size

Page 3: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Sequential Files

• Records always read in sequence

• 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

Page 4: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Sequential Files

• May be sorted into any sequence using any field in record– To distribute checks more easily, records may

be sorted by department

• Sequential processing then used to print checks, reading first record, then second, etc.

Page 5: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Master File Procedures

Typical procedures for sequential processing in batch mode are:

• Designing Master File

• Creating Master File

• Creating Transaction File

• Updating Master File

• Reporting from Master File

Page 6: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Designing a Master File

• Place key fields that uniquely identify record at beginning of record

• If possible, choose numeric key fields

• Secondary fields after primary key fields

• Remaining fields appear in order of importance

• Group common fields together (i.e., address)

Page 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

Designing a Master File

• Choose field size large enough to accommodate data stored in it

• Use coded fields where possible to save space

• Be sure all date fields include four-digit year

Page 8: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Creating a Master File

• Original master file data entered interactively, stored on disk file

• 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

Page 9: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Creating a Transaction File

• Changes to master file made with separate procedure

• Change records stored in file called transaction file

Page 10: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Updating a Master File

• Updating is process of making master file current

• Update master file by incorporating changes from transaction records

Page 11: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Reporting from a Master File

• Scheduled reports prepared on regular basis from data stored in master file– Sales reports, customer bills, checks, etc.– Use detail, exception and group printing

techniques

• On demand reports produced as need arises– May be in report form or displayed on screen

Page 12: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Creating Master, Transaction Files

• Data may be read in from another file or entered interactively from keyboard

• If data entered is valid, move it to master or transaction record fields

• WRITE new record to file

Page 13: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Sequential File Updating

Two input files

• Input Master File (Old-Master)– Current through previous updating period– Does not contain changes since previous

update

• Input Transaction File (Trans-File)– Contains changes since previous update to

be applied to Old-Master

Page 14: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Sequential File Updating

Two output files

• Output Master File (New-Master)– Integrates data from Old-Master with all of

changes from Trans-File– Will become Old-Master for next update

• Control Listing or Audit Trail– Print file showing changes made to master

file, errors during processing and control totals

Page 15: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Ordering of Records

• 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

Page 16: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Master/Transaction Processing

• Records in both files must be sorted (sequenced) on the same key

• Records from each file are “matched”

Page 17: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch

Student Master File

000000001ALBRIGHT ANDREW 300100 000000002ALLEN MICHAEL 160050 000000003AMSTER BRADLEY 380110 000000004ANCONA VIRGINIA 180055

Student Grade Transaction

000000002MICHAEL ALLEN IFS1053A 000000003BRADLEY ARMBRUSTER IFS1053A 000000003BRADLEY ARMBRUSTER IFS1103A 000000003BRADLEY ARMBRUSTER IFS2103A

Page 18: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch
Page 19: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch
Page 20: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch
Page 21: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch
Page 22: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch
Page 23: Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch