Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
2-File Match/Merge sample code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 5943
Location: 221 B Baker St

PostPosted: Tue Jul 10, 2007 9:12 pm    Post subject: 2-File Match/Merge sample code
Reply with quote

Hello,

Attached to this "sticky" is a small sample program that matches/merges 2 sequential files that have been previously put "in sequence".

Depending on your exact requirement, changes may need to be made, but the overall process works for most cases. If your files have a 1-to-1 or a 1-to-many relationship, the model should work for you. One case where additional code may be needed is when both files might have duplicate key values. The issue may be how to determine how the duplicates should "sync up".

Something to keep in mind is that to keep things more manageable you do not want to code compares for multiple keys. As you read records (before any comparing) combine the "key" fields into a ws field (one for each file) so the compare does not become other than simple.

If you find a typo or a "real" error, please let me know via PM. If you prefer a different way, fine, but this is an approach that works many, many places.

I cannot emphasize enough that it is critical that you thoroughly test your version of the code before production implementation.
Back to top
View user's profile Send private message
References
PostPosted: Tue Jul 10, 2007 9:12 pm    Post subject: Re: 2-File Match/Merge sample code Reply with quote

Purnendu.it

New User


Joined: 11 May 2007
Posts: 26
Location: chennai

PostPosted: Wed Sep 19, 2007 3:42 pm    Post subject:
Reply with quote

Hi dick,
I want to inform you that the code you have is not coming in proper alignment after download.
Please can you send it in a proper alignment

Thanks in advance,
Purnendu.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 967
Location: At my desk

PostPosted: Wed Sep 19, 2007 3:47 pm    Post subject:
Reply with quote

I sometimes find that if you just save the unopened file to your PC before opening it, everything will align properly....Something about how the browser sees a txt file and how notepad sees that same file....
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 5943
Location: 221 B Baker St

PostPosted: Wed Sep 19, 2007 8:32 pm    Post subject:
Reply with quote

Hello Purnendu,

As CG suggests, saving the file to your local drive will "clean it up".

Many of the attached text files do not open properly in browser windows.

Please let us know if it doesn't open properly after you right-click/save as.
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 26
Location: chennai

PostPosted: Thu Sep 20, 2007 2:19 pm    Post subject:
Reply with quote

HI dick,
Yes its working properly.When i was downloading it was
having improper alignment but after i tried as you suggested its perfectly
alright.

Thanks
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 5943
Location: 221 B Baker St

PostPosted: Thu Sep 20, 2007 7:37 pm    Post subject:
Reply with quote

You're welcome icon_smile.gif

Thanks for letting us know that it worked for you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1