IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to cmpare 2 records using its copy structure


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajaybshukla

New User


Joined: 09 Sep 2008
Posts: 39
Location: india

PostPosted: Mon Jun 01, 2009 5:16 pm
Reply with quote

Hi all,

I want ur help..
i have to compare 2 records of two different files, field by field using a cobol progra.
i have 2 i/p files with same record structure bt may have different values.

Now i want 2 find which field is differing out of these two file records.

ultimately i have to compare two records using their copybook. I cant check field by field as its a big file having record size of 30k.

i cud hv find out difference but i m unable to find out the exact field.

so can u plz suggest me a solution.

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

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 01, 2009 5:47 pm
Reply with quote

Sometimes it is necessary for a programmer to actually resort to writing a program. 30K records a somewhat large how many fields are in the records? By carefully formatting your if statements and such you could accomplish a lot by using cut and paste and change when you are writing the program.
Back to top
View user's profile Send private message
ajaybshukla

New User


Joined: 09 Sep 2008
Posts: 39
Location: india

PostPosted: Mon Jun 01, 2009 5:52 pm
Reply with quote

thts true...
but its having too big structure as well...and having many occurs
tht is why i came here for any good innovative solution...
if u kno any plz suggest me...
Back to top
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Mon Jun 01, 2009 5:54 pm
Reply with quote

ajaybshukla,
Quote:
i have to compare 2 records of two different files, field by field using a cobol progra.
And then
Quote:
I cant check field by field as its a big file having record size of 30k.

So, is this a VSAM file or a sequential.For example if there are 5 records in file A and 10 records in then B will you have 50 iterations for the complete comparison?Please elaborate a little more on the requirement side.

WTH.
Back to top
View user's profile Send private message
ajaybshukla

New User


Joined: 09 Sep 2008
Posts: 39
Location: india

PostPosted: Mon Jun 01, 2009 6:03 pm
Reply with quote

i have 2 PS files
i have file 1 and file 2 having same record size 30k and same copybook or structure.
file 1 wid 1 record and file 2 wid 1record.
now i want to compare these 2 file records.
if we directly compare it wont work for me as i want field which is having difference.

i think this is very much clear.

thanks
Back to top
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Mon Jun 01, 2009 6:27 pm
Reply with quote

Quote:
i think this is very much clear.

Thanks,It was always clear to you and to us.
Quote:
but its having too big structure as well...and having many occurs
It would be a one time effort and I would suggest you go by Craq's post.

WTH.
Back to top
View user's profile Send private message
ajaybshukla

New User


Joined: 09 Sep 2008
Posts: 39
Location: india

PostPosted: Mon Jun 01, 2009 6:36 pm
Reply with quote

hi..
that means there is no solution...neways thanks for ur help
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jun 01, 2009 7:12 pm
Reply with quote

between files having the same structure.

Then use File-Aid, SuperC, Comparex or Ecomp
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Jun 01, 2009 10:59 pm
Reply with quote

Hello,

If you are unwilling to write the code to compare field-by-field, you could write simpler code that would compare byte-for-byte and list the record number and the unequal displacements in the records of the ones that have one or more mis-matched bytes.

The output would be more difficult to work with, but you nearly completely avoid having to program. . .
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 01, 2009 11:40 pm
Reply with quote

If the copy books are accurate and readable, in 6 hours I could have setup a lot of "IF" statements and displays.
Back to top
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Mon Jun 01, 2009 11:53 pm
Reply with quote

Quote:
If the copy books are accurate and readable, in 6 hours I could have setup a lot of "IF" statements and displays.
By now ajaybshukla would have written the code ..its more than 6 hours icon_biggrin.gif.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top