Indexed Files continued. Figure 17.1 Sequential Update OLD MASTER TRANSACTION NEW MASTER ERROR MESSAGES UPDATE PROGRAM.

Slides:



Advertisements
Similar presentations
Methodology for Program Development Tuition billing program –Specs –File descriptions –Report layout –Processing requirement $200/cr $25 union dues if.
Advertisements

Repetition Control Structures School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 9, Friday 3/07/2003)
Programming Logic and Design Sixth Edition
Session Objectives# 24 COULD code the solution for an algorithm
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.
Processing with VSAM Files Please use speaker notes for additional information!
Page 13 1.a) A block is a group of records. A block is referred to as the UNIT of TRANSFER In computer files as when a record is searched / updated the.
Data Model Examples: DFD’s and System Flowcharts
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
CICS-Dbg1 Testing and Debugging Programmers responsibility that program works correctly! Can write program incrementally You must test anything that the.
General Algorithms for Common Business Problems
What Are File Maintenance Techniques and Validation Techniques?
Chapter 17 Sequential File Maintenance. Figure 17.1 Sequential Update OLD MASTER TRANSACTION NEW MASTER ERROR MESSAGES UPDATE PROGRAM.
Any Questions!. Agenda Fun with Functions –how to get the system date Condition Names INDARA and SI Iteration Logical Files Positioning the file pointer.
Chicago MetaStock User Group The Downloader ® Downloader ® and MetaStock ® Are Trademarks of Equis® International
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)
Relative Files.. Creating a Relative File $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. CreateRelativeFromSeq. * Creates a Relative file.
Ensure that the Field Day Call Sign is correct.
A453 Exemplar Password Program using VBA
Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch.
The Fun That Is File Structures Pages By: Christine Zeitschel.
Pseudocode Demo for Payroll.c
Data and its manifestations. Storage and Retrieval techniques.
Module 2: Creating Efficient Replication Solutions.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
Array Processing.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
More about Databases. Data Entry through Forms Table View (Data sheet view) is useful for data entry of new records But sometimes customization would.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 5 Arrays.
Indexed and Relative File Processing
Edit Programs Please use speaker notes for additional information. Example: payedit.cbl payedit.cbl.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 7 Files.
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.
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.
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
BACS 287 Programming Logic 2. BACS 287 Sequence Construct The sequence construct is the default execution mode for the CPU. The instructions are executed.
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.
 Files are used for long-term retention of large amounts of data, even after the program that created the data terminates.  persistent data.  The smallest.
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.
1 Chapter 5 – The Procedure Division File handling statements –OPEN statement Initiates processing for a file Input Output Each file opened must have been.
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
Any Questions!. Agenda Fun with Functions –how to get the system date –How to get the next service date INDARA and SI Condition Names Iteration Logical.
Chapter 11 Data Validation. Question Should your program assume the data is correct, or should your program edit the data to ensure it is correct?
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.
Session Objectives Reserved Words and Object type Conditional Usage of Reserved Words Usage of Conditional Logic 2.
This is It! It’s been a pleasure! Final Exam – format True / false 5 Multiple choice 5 Short answers10 Data manipulation10 SQL 3 Array’s12 File processing25.
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.
Indexed Files.. Creating an Indexed File $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. CreateIndexedFromSeq. * Creates an indexed file.
Chapter 9 General algorithms for common business problems.
Any Questions!. Agenda Fun with Functions Externally Described Files Condition Names Iteration Logical Files Random Reads.
VSAM ESDS and RRDS Department of Computer Science Northern Illinois University September 2005 Some of the illustrations are from VSAM: Access Method Services.
Flow chart of the program Start Input a password Is it greater than 6 characters No Is it greater than 6 characters Is it greater than 12 characters yes.
DATA MANAGEMENT AND DATABASES. Data Management Data management is the process of controlling the information generated during a research project or transaction.
Random update Please use speaker notes for additional information!
Sequential Processing to Update a File Please use speaker notes for additional information!
Array Applications. Objectives Design an algorithm to load values into a table. Design an algorithm that searches a table using a sequential search. Design.
File and Database Processing
Designing and Debugging Batch and Interactive COBOL Programs
Any Questions?.
Agenda Test next Week! SI or no SI? File Update Techniques – Review.
Please use speaker notes for additional information!
Please use speaker notes for additional information!
Presentation transcript:

Indexed Files continued

Figure 17.1 Sequential Update OLD MASTER TRANSACTION NEW MASTER ERROR MESSAGES UPDATE PROGRAM

Figure 17.2 Sequential Update with Data Files ERROR MESSAGES: NO MATCH DUPLICATE ADDITION SEQUENTIAL UPDATE OLD MASTER FILE: ADAMS NEW YORK BAKER NEW YORK ZIDROW NEW YORK MILGROM BOSTON BENJAMIN CHICAGO SHERRY CHICAGO BOROW BOSTON JAMES NEW YORK RENAZEV NEW YORK TRANSACTION FILE: C BOSTON C NEW EMPLOYEE BOSTON A C NEW EMPLOYEE II CHICAGO A NEW YORK C SHERRY D C JAMES NEW YORK A NEW MASTER FILE: ADAMS NEW YORK BAKER NEW YORK ZIDROW NEW YORK MILGROM BOSTON NEW EMPLOYEE BOSTON BENJAMIN CHICAGO NEW EMPLOYEE II NEW YORK SHERRY CHICAGO BOROW NEW YORK JAMES NEW YORK RENAZEV NEW YORK

Figure 17.4 Sequential Update with Data Validation TRANSACTION FILE OLD MASTER STEP 1: EDIT NEW MASTER STEP 2: UPDATE VALID TRANSACTIONS ERROR MESSAGES

Figure 17.3 Two-period Sequential Update MASTER AS OF 1/1 JANUARY TRANSACTIONS MASTER AS OF 2/1 UPDATE PROGRAM MASTER AS OF 3/1 UPDATE PROGRAM FEBRUARY TRANSACTIONS Processing done February 1 Processing done March 1

Figure 17.7 Pseudocode for Data Validation Program Open files DO while data remains READ transaction file AT END Indicate no more data NOT AT END Move ‘YES’ to valid-record-switch IF trans-social-security < previous-social-security Move ‘NO’ to valid-record-switch Write error message ENDIF Move trans-social-security to previous-social-security IF transaction-code is not valid Move ‘NO’ to valid-record-switch Write error message ENDIF IF addition IF transactions fails addition-check(s) Move ‘NO’ to valid-record-switch Write error message(s) ENDIF ELSE IF correction IF sales-amount not numeric Move ‘NO’ to valid-record-switch Write error message ENDIF ENDIF ENDIF IF valid-record-switch = ‘YES’ Write valid-transaction-record ENDIF ENDREAD ENDDO Close files Stop run

Figure 18.4 Pseudocode for Creating Indexed File Open files DO WHILE data remains READ record from sequential file AT END Indicate no more data NOT AT END Move sequential record to indexed record Write indexed record IF sequence error Display error - record out of sequence ENDIF IF duplicate record Display error - record already exists ENDIF ENDREAD ENDDO Close files Stop run

Figure 18.8 Hierarchy Chart for Nonsequential Update Program

Figure 18.9 Pseudocode for Nonsequential Update Program Open files DO WHILE data remains READ transaction file AT END Indicate no more data NOT AT END Move transaction social security number to record key READ INDEXEC-FILE INVALID KEY Move ‘NO’ TO record-key-allocated-switch NOT INVALID KEY Move ‘YES’ TO record-key-allocated-switch END-READ EVALUATE WHEN addition IF record-key-allocated-switch = ‘YES’ Write ‘error - duplicate addition’ ELSE (transaction is not in indexed file) Move transaction-record to new-master-record Write indexed-record ENDIF WHEN correction IF record-key-allocated-switch = ‘YES’ Process correction Rewrite indexed record ELSE (transaction is not in indexed file) Write ‘error - no matching record’ ENDIF WHEN deletion IF record-key-allocated-switch = ‘YES’ Delete indexed record ELSE (transaction is not in indexed file) Write ‘error - no matching record’ ENDIF WHEN other Write ‘error - invalid transaction’ END EVALUATE END READ END DO Close Files Stop Run

The START Statement –Start Filename Key Relational Operator – Invalid Key Statement – Not Invalid Key Statement –End-Start

Read Next –Read Filename Next Record – At End Statement –End-Read File Status (Select Filename File Status is WS-STATUS) –Refer to pages )