Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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
No new posts Garbage on output file Hervey Martinez SYNCSORT 1 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 1 Tue Sep 26, 2017 3:35 am
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us