Two file sequential file processing (maximum 1 record per id on each file) Please use speaker notes for additional information!

Slides:



Advertisements
Similar presentations
Playing computer with logic problems Please use speaker notes for additional information!
Advertisements

STUDENT INFORMATION SYSTEM (SIS) Online Adjustment Approval User: Academic Advisers July 22, 2014.
Three file matching Please use speaker notes for additional information!
Creating Flowcharts Principles Of Engineering
Processing with VSAM Files Please use speaker notes for additional information!
Chapter 9 Describing Process Specifications and Structured Decisions
General Algorithms for Common Business Problems
SQL for Data Retrieval. Save your SQL Scripts When working with SQL Management Studio, you should keep saving your scripts as a.sql file to somewhere.
VSAM KSDS and COBOL Department of Computer Science Northern Illinois University August 2005 Some of the illustrations are from VSAM: Access Method Services.
Break Processing Please use speaker notes for additional information!
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
Logic Structure - focus on looping Please use speaker notes for additional information!
Array - adding to array at run time Please see speaker notes for additional information!
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
DON’T DO IT! IT’S NOT HOPELESS. Documentation Flowcharting Due to thier complexity (when looking at them), flowcharts intimidate many people. However,
Logic Problems This is an assignment. There are no speaker notes.
1 Lab 2 and Merging Data (with SQL) HRP223 – 2009 October 19, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
Edit Programs Please use speaker notes for additional information. Example: payedit.cbl payedit.cbl.
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.
Random Files Please see speaker notes for additional information!
General Algorithms for Common Business Problems Simple Program Design Third Edition A Step-by-Step Approach 10.
Basic Control Structures
Order Entry Program Please see speaker notes for additional information!
Agenda Basic Logic Purpose if statement if / else statement
Python Selection. All the programs you have been developing so far have been sequential, this means that each instruction is executed in a set order.
SQL for Data Retrieval. Save your SQL Scripts When working with SQL Management Studio, you should keep saving your scripts as a.sql file to somewhere.
1 Chapter 9. To familiarize you with  Simple PERFORM  How PERFORM statements are used for iteration  Options available with PERFORM 2.
Databases.  A database is simply a collection of information stored in an orderly manner.  A database can be as simple as a birthday book, address book.
Label Assignment Please use speaker notes for additional information!
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
INSTRUCTOR: JOAN RABIDEAU Unit 5 ~ CS119 is the fastest way to reach me to get assistance and support! AIM – joanlrabideau.
13- 1 Chapter 13.  Overview of Sequential File Processing  Sequential File Updating - Creating a New Master File  Validity Checking in Update Procedures.
Visual Basic I/O Programs (ProjRead1, ProjRead2, ProjWrite1, ProjPay) Please use speaker notes for additional information!
SAG INFOTECH PVT. LTD Help Manual For New Challans correction statement SOFT SOLUTION FOR THOSE WHO CAN”T AFFORD TO MAKE ERROR.
Inequality Signs < means “is less than”  means “is less than or equal to” > means “is greater than”  means ”is greater than or equal to” Reading Inequalities.
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.
A am going to create a table in design view. I am going to create a table in an Access database that contains information about the books that I have on.
Asset and eProcurement Fred Van Dorp AOS
Using a Database Access97 Please use speaker notes for additional information!
How to Import Patient Files Identify Patient ID number from current OPD database and make note on paper.
Random update Please use speaker notes for additional information!
Sequential Processing to Update a File Please use speaker notes for additional information!
I recently upgraded to this version of Proclaim Before the upgrade I was able to import.xml files from OpenSong. Since the upgrade I am no longer able.
Loop Assignment There are no speaker notes to accompany this assignment.
Summary of the November 11, 2002 Market Synchronization “How-to-Fix” Decisions For presentation to RMS November 14, 2002.
Lawson Mid-America User Group Spring 2016 Meeting.
IF Statements flowcharts and pseudocode Please open the speaker notes - they contain additional information!
Visual Basic - Break Processing
Processing multiple files
Using Subqueries to Solve Queries
Flowchart Symbols Terminal Process Input/ Output Decision
Chapter 11 Describing Process Specifications and Structured Decisions
Comparison Operators Relational Operators.
Subqueries.
Model Functions Input x 6 = Output Input x 3 = Output
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Please use speaker notes for additional information!
STUDENT INFORMATION SYSTEM (SIS)
Please use speaker notes for additional information!
Programming Logic and Design Fourth Edition, Comprehensive
Iteration: Beyond the Basic PERFORM
Searching an Array or Table
Please use speaker notes for additional information!
Using Subqueries to Solve Queries
Using Subqueries to Solve Queries
Subqueries Schedule: Timing Topic 25 minutes Lecture
2 file sequential matching with multiple records allowed on file 2
More on If statements (Calculate, Calculate1, Calculate2)
Access Click on file and then you want a new database.
Presentation transcript:

Two file sequential file processing (maximum 1 record per id on each file) Please use speaker notes for additional information!

ID1>ID2 Merge 2 files Prepare record from file 2 to write Write output record Read file2 record Prepare record from file 1 to write Write output record Read file1 record Reading two files and creating a single merged output file with all records from file 1 and file2. Two ways of drawing the flowchart are shown. ID1: ID2 Prepare record from file 2 to write Write output record Read file2 record Prepare record from file 1 to write Write output record Read file1 record ><=YN

Merge 2 files Read record from each file prior to the logic shown. ID1 (111) is not greater than ID2 (111). They are equal. The logic says to prepare record from file1 (111100) to write and write it. Then read another record from file1. File12.dat

ID1 (222) is greater than ID2 (111). The logic says to prepare record from file2 (111010) to write, write it Then read another record from file2. File12.dat Merge 2 files

ID1(222) is not greater than ID2 (222), in fact they are equal. The logic says to prepare record from file1 to write and write it. Then read another record from file1. File12.dat Merge 2 files

ID1(333) is greater than ID2 (222). The logic says to prepare record from file2 to write and write it. Then read another record from file2. File12.dat Merge 2 files

ID1(333) is greater than ID2 (300). The logic says to prepare record from file2 to write and write it. Then read another record from file2. File12.dat Merge 2 files

ID1 (333) is not greater than ID2 (333), in fact they are equal. The logic says to prepare record from file1 to write and write it. Then read another record from file1. File12.dat Merge 2 files

ID1 (444) is greater than ID2 (333). The logic says to prepare record from file2 to write and write it. Then read another record from file2. File12.dat Merge 2 files

ID1 (444) is not greater than ID2 (444), in fact they are equal. The logic says to prepare record from file1 to write and write it. Then read another record from file1. File12.dat Merge 2 files

ID1 (555) is greater than ID2 (444). The logic says to prepare record from file2 to write and write it. Then read another record from file2. File12.dat Merge 2 files

ID1 (555) is not greater than ID2 (666). The logic says to prepare record from file1 to write and write it. Then read another record from file1. File12.dat Merge 2 files

ID1 (666) is not greater than ID2 (666), in fact they are equal. The logic says to prepare record from file1 to write and write it. Then read another record from file1. File12.dat Merge 2 files

ID1 (888) is greater than ID2 (666). The logic says to prepare record from file2 to write and write it. Then read another record from file2. File12.dat Merge 2 files

ID1 (888) is greater than ID2 (777). The logic says to prepare record from file2 to write and write it. Then read another record from file2. End of file has been reached. File12.dat Merge 2 files I am going to set the id from file2 to 999 so it will compare high when there is still data on file1.

ID1 (888) is not greater than EOF where I set ID2 (999). The logic says to prepare record from file1 to write and write it. Then read another record from file1. End of file has been reached. File12.dat Merge 2 files I am going to set the id from file1 to 999 so it will compare high when there is still data on file2.

On file 1 or 2 or both ID1 > ID2 Prepare record from file 2 to write Write output record Read file2 record Prepare record from file 1 to write Write output record Read file1 record YN ID1 = ID2 Prepare record from file 1 & file 2 to write Write output record Read file1 record YN Read file2 record File 1 and file 2 have a maximum of 1 record per id. However the same id can appear on both files.

ID1 : ID2 Prepare record from file 2 to write Write output record Read file2 record Prepare record from file 1 to write Write output record Read file1 record >< Prepare record from file 1 & file 2 to write Write output record Read file1 record Read file2 record On file 1 or 2 or both - alternative =

On file 1 or 2 or both ID1 (111) is equal to ID2 (111). In this example, I will then add the amounts in amt from file1 (100) and amt from file2 (010) and write a new record containing id 111 and the total 110. I will then read a new record from both file 1 and file 2. File12ok.dat

On file 1 or 2 or both ID1 (222) is equal to ID2 (222). In this example, I will then add the amounts in amt from file1 (200) and amt from file2 (020) and write a new record containing id 222 and the total 220. I will then read a new record from both file 1 and file 2. File12ok.dat

On file 1 or 2 or both ID1 (333) is greater than ID2 (300). In this example, I will then move the id and the amt from the record on file2 and write a new record containing id 300 and the total 030. I will then read a new record from file 2. File12ok.dat

On file 1 or 2 or both ID1 (333) is equal to ID2 (333). In this example, I will then add the amounts in amt from file1 (300) and amt from file2 (000) and write a new record containing id 333 and the total 300. I will then read a new record from file1 and a new record from file 2. File12ok.dat

On file 1 or 2 or both ID1 (444) is equal to ID2 (444). In this example, I will then add the amounts in amt from file1 (400) and amt from file2 (040) and write a new record containing id 444 and the total 440. I will then read a new record from file1 and a new record from file 2. File12ok.dat

On file 1 or 2 or both ID1 (555) is less than ID2 (666). In this example, I will then move the id and the amt from the record on file1 and write a new record containing id 555 and the total 500. I will then read a new record from file1. File12ok.dat

On file 1 or 2 or both ID1 (666) is equal to ID2 (666). In this example, I will then add the amounts in amt from file1 (600) and amt from file2 (060) and write a new record containing id 666 and the total 660. I will then read a new record from file1 and a new record from file 2. File12ok.dat

On file 1 or 2 or both ID1 (888) is greater than ID2 (777). In this example, I will then move the id and the amt from the record on file2 and write a new record containing id 777 and the total 070. I will then read a new record from file1. There is no new record so EOF has been reached. File12ok.dat I am going to set the id from file2 to 999 so it will compare high when there is still data on file1.

On file 1 or 2 or both ID1 (888) is less than ID2 (999) which has been set that way because EOF was reached on file2.. In this example, I will then move the id and the amt from the record on file1 and write a new record containing id 888 and the total 800. I will then read a new record from file1. There is no new record so EOF has been reached. File12ok.dat I am going to set the id from file2 to 999 so it will compare high when there is still data on file1.

Required matching record ID1 > ID2 Set up missing record from file 1 error Write or display error Read file2 record Set up missing record from file2 error Write or display error Read file1 record YN ID1 = ID2 Prepare record from file 1 & file 2 to write Write output record Read file1 record YN Read file2 record

Must be on 1 and 2 ID1 (111) is equal to ID2 (111). In this example, I will then add the amounts in amt from file1 (100) and amt from file2 (010) and write a new record containing id 111 and the total 110. I will then read a new record from both file 1 and file 2. File12cb.dat

Must be on 1 and 2 ID1 (222) is equal to ID2 (222). In this example, I will then add the amounts in amt from file1 (200) and amt from file2 (020) and write a new record containing id 222 and the total 220. I will then read a new record from both file 1 and file 2. File12cb.dat

Must be on 1 and 2 ID1 (333) is greater than ID2 (300). In this example, I will then write the record from file 2 on the error report. I will then read a new record from file 2. File12cb.dat MISSING RECORD FROM FILE 1

Must be on 1 and 2 ID1 (333) is equal to ID2 (333). In this example, I will then add the amounts in amt from file1 (300) and amt from file2 (000) and write a new record containing id 333 and the total 300. I will then read a new record from file1 and a new record from file 2. File12cb.dat MISSING RECORD FROM FILE 1

Must be on 1 and 2 ID1 (444) is equal to ID2 (444). In this example, I will then add the amounts in amt from file1 (400) and amt from file2 (040) and write a new record containing id 444 and the total 440. I will then read a new record from file1 and a new record from file 2. File12cb.dat MISSING RECORD FROM FILE 1

Must be on 1 and 2 ID1 (555) is less than ID2 (666). In this example, I will then write the record from file 1 on the error report. I will then read a new record from file 1. File12cb.dat MISSING RECORD FROM FILE MISSING RECORD FROM FILE 2

Must be on 1 and 2 ID1 (666) is equal to ID2 (666). In this example, I will then add the amounts in amt from file1 (600) and amt from file2 (060) and write a new record containing id 666 and the total 660. I will then read a new record from file1 and a new record from file 2. File12cb.dat MISSING RECORD FROM FILE MISSING RECORD FROM FILE 2

Must be on 1 and 2 ID1 (888) is greater than ID2 (777). In this example, I will then write the record from file 2 on the error report. I will then read a new record from file 2. File12cb.dat MISSING RECORD FROM FILE MISSING RECORD FROM FILE MISSING RECORD FROM FILE 2 When I attempt to read from file 2, EOF is reached. I will then set the id to 999 for comparison.

Must be on 1 and 2 ID1 (888) is less than ID2 (999 for EOF). In this example, I will then write the record from file 1 on the error report. I will then read a new record from file 1. File12cb.dat MISSING RECORD FROM FILE MISSING RECORD FROM FILE MISSING RECORD FROM FILE MISSING RECORD FROM FILE 2 When I attempt to read from file 1, EOF is reached. Since both files have reached EOF, processing is over.