View previous topic :: View next topic
|
Author |
Message |
sarithakjumla
New User
Joined: 21 May 2010 Posts: 2 Location: mysore
|
|
|
|
hi all,
pgm currently reads two sequential files(sorted) and generates o/p file.
For each account read that meets at least 1 of the 12 criteria(conditions are not of much importance as of now) a record will be written to the new file.
how to go about this?
Thanks,
Saritha |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
Define "account"
What's in File1 ? how many records per account? sorted on what ?
What's in File2 ? how many records per account? sorted on what ?
And it probably is a normal merge program, something every cobol developer should have learned in the course "structured programming". |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
sarithakjumla wrote: |
how to go about this? |
Let me get this straight, as a "developer" with a mainframe skill in Cobol, you need help in writing a simple program?
I suggest you look into the IBM MAINFRAME FORUM |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
anybody that has to ask,
deserves what they get.
here is something to start with
Code: |
PERFORM READ-FILE-ONE
PERFORM READ-FILE-TWO
PERFORM UNTIL FILE-ONE-EOF
AND FILE-TWO-EOF
EVALUATE TRUE
WHEN FILE-ONE-EOF
PERFORM PROCESS-FILE-TWO-ONLY
PERFORM READ-FILE-TWO
WHEN FILE-TWO-EOF
PERFORM PROCESS-FILE-ONE-ONLY
PERFORM READ-FILE-ONE
WHEN OTHER
EVALUATE TRUE
WHEN FILE-ONE-KEY = FILE-TWO-KEY
PERFORM PROCESS-FILE-MATCH
PERFORM READ-FILE-ONE
PERFORM READ-FILE-TWO
WHEN FILE-ONE-KEY < FILE-TWO-KEY
PERFORM PROCESS-FILE-ONE-ONLY
PERFORM READ-FILE-ONE
WHEN OTHER
PERFORM PROCESS-FILE-TWO-ONLY
PERFORM READ-FILE-TWO
END-EVALUATE
END-EVALUATE
END-PERFORM
|
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
At the top of the COBOL part of the forum is a "Sticky" for 2-file match/merge (dbz has posted the direct link).
This has tested code that does what i believe you want to do. All you would do is modify for your particulars. |
|
Back to top |
|
|
|