Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sequential file update

Status
Not open for further replies.

luckysherrif

Programmer
Feb 19, 2015
5
RO
Hello guys,
I need to make a program to update a masterfile from transfer file by computing them. Problem is that the transfer file has multiple keys with same record that need to be computed to only one key in master file. I have done updates but only with same number of records in master and transfer file. Any hints please?
Thank you!
 
You sort each file on your keyfield. You process each record that applies to that masterfile record, then read the next masterfile record when you have exhausted all the transfer transactions. Continue by processing all the transfer transaction records that apply to that masterfile. There is some minor logic if you have masterfile records without transfer transactions and vice versa.

==================================
adaptive uber info galaxies (bigger, better, faster than agile big data clouds)


 
Can you give an example of a record in masterfile, And its multiply records in the transfer file?
 
TRANSFER FILE
JOHN DOE 1680.00
JOHN DOE -320.99
JOHN DOE 401.00
JOHN DOE -20.00

MASTERFILE
JOHN DOE 2100

The update must be sequentially made, I can't use ws-memory... Iț's sorted out in my mind, just have to write the code and test :). An advice would be nice...Thanks!
 
It's kinda sorted out now, but at some point, it kicks me out with an error: Failed to read (STATUS = 46) File : 'TRANSFER.DAT'. It makes the math ok, but it kicks me out before i write the files. Anyone that can help??? I can send the code, it is a short file with 150 lines.... Thank you!
 
SORTED, it was and end-of-file condition that gave me headaches... solved with an 'OR' condition. PS: if anyone knows another cobol forum :))) more active... Keep the spaghetti going!
 
luckysherrif said:
if anyone knows another cobol forum :))) more active.

Actually, this is probably one of the most active COBOL forums on the net. When I saw your original post, it seemed to be a 'student post'; subsequent postings seemed to validate that opinion. The question you are asking is one that would not be typical of a professional programmer, unless this was his first attempt to use COBOL. The question you are asking is very typical of problems used in COBOL programming classes. Because of this, I did not respond to your original post. My guess is that several other active members of this forum also chose not to respond.

Finally, you did not post what code you already had tried, so there was not a good starting point.

I apologize if I came to the wrong conclusion. Even if you are a student there are many professionals on this forum that will help you if you show the code you have already tried. Most of us do not mind helping students become good COBOL programmers (we need more good COBOL programmers). We just don't want to do homework problems without a 'good faith effort' on the part of the student.
 
Actually, this COBOL forum has very little activity compared with those on the various mainframe forums - Google to find them.


Nic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top