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
 

 

File merging in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kumar32149

New User


Joined: 22 Sep 2010
Posts: 9
Location: India

PostPosted: Thu Jan 06, 2011 6:18 pm    Post subject: File merging in COBOL
Reply with quote

Please read the following sample data for master file and transaction file and advise me on this issue.

file 1 is master file and file2 is transaction file. I would like to merge two files based on the account number but I want duplicate records from transaction file.

file 1

SNO ACCNUM
1 100
2 101
3 102
4 103


file 2

ACCNUM AMOUNT DATE
100 200 1/1/2010
101 321 2/2/2010
101 400 2/2/2010
102 700 3/2/2010


output

sno accnum amount date
1 100 200 1/1/2010
2 101 321 2/2/2010
3 400 2/2/2010
4 102 700 3/2/2010
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Thu Jan 06, 2011 7:58 pm    Post subject: Reply to: file merging
Reply with quote

Other than what appears to be a typo in your output example, this seems to be a relatively simple process. I don't understand what you're asking for assistance on?
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 Jan 06, 2011 9:30 pm    Post subject:
Reply with quote

Hello,

Sort both files on accnum and then download the sample 2-file match/merge code from the "Sticky" at the top of this COBOL part of the forum.

With minor modification, the sample code will do what you want.

Possibly i misunderstand what you are looking for. . .
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 Jan 07, 2011 11:34 am    Post subject:
Reply with quote

Hello,

You need to sort the files before using the match/merge code. . .

The code in the "Sticky" has handled more than 500 million records. . . Why do you believe the code would be different for larger or smaller volumes of data?
Back to top
View user's profile Send private message
kumar32149

New User


Joined: 22 Sep 2010
Posts: 9
Location: India

PostPosted: Fri Jan 07, 2011 4:27 pm    Post subject: Reply to: File merging in COBOL
Reply with quote

sorry for wrong question actually i should achive this without SORT Utility
am asking cobol logic for this
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 Jan 07, 2011 8:12 pm    Post subject:
Reply with quote

Hello,

You are going to have an ugly experience in IT if you do not learn to read what you have been given and apply this. . .

I told you where to find the COBOL code to do this. Just download it (right-click save-as), modify for your specifics, and run it. . .
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 Jan 07, 2011 8:14 pm    Post subject:
Reply with quote

Follow on:

We have a spearate forum for Students & Freshers that may be more suited to your level of experience.

http://www.ibmmainframeforum.com/index.php
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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