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: 7314
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: 34
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: 1117
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: 7314
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: 34
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: 7314
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
hanucob

New User


Joined: 15 Jul 2008
Posts: 4
Location: bangalore

PostPosted: Wed Jul 16, 2008 10:37 am    Post subject:
Reply with quote

I your file is not ease for use ...its in irregular format after down loading,
please send it in correct way
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


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

PostPosted: Wed Jul 16, 2008 8:00 pm    Post subject:
Reply with quote

Hello Hanu,

Please re-read the replies to this topic.

The file is easy to use if you follow the directions. . .
From earlier. . .
Quote:
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.


So, if you right-click, save as and still have trouble, let us know. If you have trouble, you will be the only one who does. . .
Back to top
View user's profile Send private message
ntmartins

New User


Joined: 03 Mar 2008
Posts: 3
Location: Portugal

PostPosted: Fri Jul 18, 2008 8:48 pm    Post subject: Structured programing
Reply with quote

Hi,

Think this sample program will be usefull to less experienced programmers.

But it does not meet most companys standards. Usage of "GO TO", for instance, instruction is not accepted in many companys.

Any way, thanks.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


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

PostPosted: Fri Jul 18, 2008 9:04 pm    Post subject:
Reply with quote

Hello,

Quote:
Think this sample program will be usefull to less experienced programmers.
Yes, this was to provide compilable/executable pseudo-code for learning - many training centers do not appear to teach/require the students understand this very basic process that is in every application i've ever seen.

Quote:
But it does not meet most companys standards. Usage of "GO TO", for instance, instruction is not accepted in many companys.
Most companies (at least those that are well managed) have backed off of the "no go to" rule. It has been demonstrated many, many times that properly used, there is nothing wrong with a go to.

Most places that have standards concerning the use of "go to" permit this in these situations:

1. To go to the end of a routine (i.e. AT END).
2. To go to the top of a routine.
3. To go to an abend procedure.

One of the reasons for "go to less" programming was so code would be "structured". Unfortunately, no "go to"s does not guarantee well structured code. Another issue we discovered/documented "back then" was that whe programs always ran inside some PERFORMs, system paging was greatly increased.

As far as code is concerned (i've supported very many organizations whose standards greatly differ), i believe code should always work correctly, be maintainable, and not use an excessive amount of system resources. These goals can be accomplished with or without permission/prevention of "go to".
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