Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Program to matches/merges two sequential files
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jul 10, 2007 9:12 pm    Post subject: Program to matches/merges two sequential files
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

Purnendu.it

New User


Joined: 11 May 2007
Posts: 59
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: 2150
Location: At my coffee table

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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: 59
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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: 12
Location: Lisboa, 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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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
rbi

New User


Joined: 25 Sep 2008
Posts: 3
Location: NC

PostPosted: Wed Oct 01, 2008 8:30 pm    Post subject: Reply to: 2-File Match/Merge sample code
Reply with quote

Hi,

How do I get the attached file? I can't seem to find it.

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

New User


Joined: 25 Sep 2008
Posts: 3
Location: NC

PostPosted: Wed Oct 01, 2008 8:31 pm    Post subject:
Reply with quote

Hi,

Don't worry about, I've found it.

thanks again.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 01, 2008 8:57 pm    Post subject:
Reply with quote

Hello and welcome to the forums,

Quote:
How do I get the attached file?

Quote:
Don't worry about, I've found it.
Yup, as soon as you post the question, there it is icon_smile.gif If you continued to dig, it would have taken longer icon_wink.gif Just the way it goes sometimes. . .

If there are any questions with the code, please post them here.

Good luck icon_smile.gif
Back to top
View user's profile Send private message
rbi

New User


Joined: 25 Sep 2008
Posts: 3
Location: NC

PostPosted: Wed Oct 01, 2008 9:04 pm    Post subject:
Reply with quote

Hi,

The code is simple, yet effective. And I agree, GO TO statement is not to be dreaded upon. Most of the time (if used properly) it yields much better performance compared to PERFORM.

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu May 14, 2009 7:24 pm    Post subject:
Reply with quote

Hello,

Right-click (Save Target As) on the DOWNLOAD link on the right-side of the attachment.

This will create a text file on your pc. Upload the code to the mainframe, make changes for your specifics and run a test.

Any problems, post back here.

If you had read the topic, you would have saved yourself some time as this has been posted multiple times (in this same topic) because of others who did not read. . .
Back to top
View user's profile Send private message
sunitatprasad

New User


Joined: 18 May 2006
Posts: 9

PostPosted: Mon Jun 08, 2009 12:20 pm    Post subject: Reply to: 2-File Match/Merge sample code
Reply with quote

Hi,

I couldn't find the attachment.

Thanks,
Sunita
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Mon Jun 08, 2009 12:43 pm    Post subject:
Reply with quote

Hello,

Did you follow the steps mentioned by dick above? Are you getting any error?
Back to top
View user's profile Send private message
sunitatprasad

New User


Joined: 18 May 2006
Posts: 9

PostPosted: Mon Jun 08, 2009 12:51 pm    Post subject: Reply to: 2-File Match/Merge sample code
Reply with quote

Hi,

After posting the reply I'm able to see the attachment. icon_smile.gif

I downloaded it also.

Thanks,
Sunita
Back to top
View user's profile Send private message
rakam.kishore

New User


Joined: 28 Mar 2008
Posts: 1
Location: hyderabad

PostPosted: Tue Jun 16, 2009 7:16 pm    Post subject: Reply to: 2-File Match/Merge sample code
Reply with quote

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 17, 2009 5:06 am    Post subject: Reply to: 2-File Match/Merge sample code
Reply with quote

You're welcome - good luck icon_smile.gif

Someone will be here if there are questions,

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us