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
 
how to find common names from two input files

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

New User


Joined: 08 Jul 2008
Posts: 11
Location: chennai

PostPosted: Tue Jul 08, 2008 6:04 pm    Post subject: how to find common names from two input files
Reply with quote

how to find common names from two input files having n names and write it into another output file?
Back to top
View user's profile Send private message

ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Jul 08, 2008 6:15 pm    Post subject:
Reply with quote

Sort both files on Name field

Read file 1
Read file 2

If Name_file1 = Name_file2
Perform below PARA until endofboth the files

PARA:
Write to o/p file
Read file 1
Read file 2
End-if
IF Name_file1 > Name_file2
Read file 2
End-if

IF Name_file1 < Name_file2
Read file 1
End-if
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Jul 08, 2008 6:16 pm    Post subject:
Reply with quote

Sorry a small mistake in earlier post :

It should be like:

Sort both files on Name field

Read file 1
Read file 2

Perform below PARA until endofboth the files

PARA:

If Name_file1 = Name_file2
Write to o/p file
Read file 1
Read file 2
End-if
IF Name_file1 > Name_file2
Read file 2
End-if

IF Name_file1 < Name_file2
Read file 1
End-if
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: Tue Jul 08, 2008 8:35 pm    Post subject:
Reply with quote

Hello sanjay and wecome to the forums,

Quote:
how to find common names from two input files having n names and write it into another output file?
Please post a few sample records from both files and the output you want when these files are processed.

I believe the posted code will not handle duplicates as a "hit".
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jul 09, 2008 12:08 pm    Post subject:
Reply with quote

Hi,

As Dick has mentioned, providing your expectations with sample input/output is always good.

However, so far it seems a standard "file-matching" problem; if so, there is a sticky in the COBOL forum for such a COBOL program. With a lilttle modification you should be ready to go, here is the link...

http://ibmmainframes.com/viewtopic.php?t=22649

If this is not what you are searching for, please clarify more.
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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

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