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

Compare two strucures which are of 22000 chars size


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

New User


Joined: 11 Apr 2008
Posts: 5
Location: hyderabad

PostPosted: Mon Jun 30, 2008 11:17 am
Reply with quote

i wanna compare two strucures which are of 22000 chars size & i wanna find the point at which they are mismatching... please tell me logic to code in pli lang....
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 30, 2008 11:21 am
Reply with quote

Hello pli guy and welcome to the forums,

Is there some reason you posted in the COBOL part of the forum?

Please clarify what you mean by structures. . . Do you mean definition or content?
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Jul 01, 2008 8:10 pm
Reply with quote

Put a loop for 22000 times and use SUBSTR function if mismatch occurs
come out of the loop
Back to top
View user's profile Send private message
pli guy

New User


Joined: 11 Apr 2008
Posts: 5
Location: hyderabad

PostPosted: Tue Jul 01, 2008 11:58 pm
Reply with quote

if you can give the logic in cobol or pli, it is fine with me.
i have a structure which collects data from some fields entered on screens. this structure i wanna compare with another structure which has same fields(values may be same or different).
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: Wed Jul 02, 2008 12:02 am
Reply with quote

Hello,

Quote:
this structure i wanna compare with another structure which has same fields(values may be same or different).
You need to make your requirement much more clear.

Pretend you only have 40-byte structures (rather than 22k). Please post some sample info from both "input"s and what you want for output. If individual fields are to be considered, you need to show the field attributes as well.
Back to top
View user's profile Send private message
pli guy

New User


Joined: 11 Apr 2008
Posts: 5
Location: hyderabad

PostPosted: Thu Jul 03, 2008 9:33 am
Reply with quote

ok fine...

strucutre1
1 field1 char(20),
1 field1 fixed dec(3,2),
1 field1 fixed dec(5,2),
1 field1 fixed dec(7,2),
1 field1 fixed dec(9,2),
1 field1 fixed dec(11,2);

strucutre2
1 field1 char(20),
1 field1 fixed dec(3,2),
1 field1 fixed dec(5,2),
1 field1 fixed dec(7,2),
1 field1 fixed dec(9,2),
1 field1 fixed dec(11,2);

these are only the diff fileds available in both the structures... now how to compare these structures and how to find out where they are mismatching? output is if while comparing, some fields mismatches then i want the field where it mismatches....
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu Jul 03, 2008 10:55 am
Reply with quote

ECOMP can easely do that

Suppose you have
STR1
Code:
  01 ZFIELD1 CHAR(22),           
  01 ZFIELD2  FIXED DEC(3,2),   
  01 ZFIELD3  FIXED DEC(5,2),   
  01 ZFIELD4  FIXED DEC(8,3),   
  01 ZFIELD5  FIXED BIN(15),     
  01 ZFIELD5A  FIXED DEC(9,2),   
  01 ZFIELD6 FIXED DEC(11,3);   

STR2
Code:
  01 ZFIELD1 CHAR(20),         
  01 ZFIELD2  FIXED DEC(3,2), 
  01 ZFIELD3  FIXED DEC(5,2), 
  01 ZFIELD4  FIXED DEC(8,2), 
  01 ZFIELD5  FIXED DEC(9,2), 
  01 ZFIELD6  FIXED DEC(11,3);


Results
Code:
Thu, Jul 03, 2008  07:22:10                                  COMPARE                                         E>>Comp V0301  OCMP001D
Page : 1                        TENV.EVOLA.CMPV9201.WRK(STR1)  AND  TENV.EVOLA.CMPV9201.WRK(STR2)                         SITE     
------------------------------------------------------------------------------------------------------------------------------------
                                                                                                                                   
                                                                                                                                   
ALPHA L1                01 ZFIELD1                               CHAR(22),                                                         
--->>                                                        >>--      -                                                        <<--
OMEGA L1                01 ZFIELD1                               CHAR(20),                                                         
                                                                                                                                   
ALPHA L4                01 ZFIELD4                               FIXED DEC(8,3),                                                   
--->>                                                        >>--            -                                                  <<--
OMEGA L4                01 ZFIELD4                               FIXED DEC(8,2),                                                   
                                                                                                                                   
ALPHA L5                01 ZFIELD5                               FIXED BIN(15),                                                     
--->>                                                        >>--      --- -----                                                <<--
OMEGA L5                01 ZFIELD5                               FIXED DEC(9,2),                                                   
                                                                                                                                   
                                                                                                                                   
ALPHA L6           01 ZFIELD5A                              FIXED DEC(9,2),                                                         
                                                                                                                                   
____________________________________________________________________________________________________________________________________


Cheers
Pierre
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: Thu Jul 03, 2008 7:02 pm
Reply with quote

Hi Pierre,

You changed the definitions to meet a different requirement?

If i understand (the TS still has still not shown input and output data, but only the defintions which are the same), the TS wants to compare those fields and when there is a difference in the data, show which field is different and the 2 values.

That was why i asked for sample data (info) from both files and the desired output.

Of course, i may completely misunderstand. . . .
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu Jul 03, 2008 9:52 pm
Reply with quote

My understandiing was the OP wants to compare structures and not data applied on that.
But as he showed 2 absolutely same structures, I guessed it was a mistake and I adapted the requirement to show how my solution is.

But OK ,maybe I am wrong. ( just to be occupied during a waiting time at work .. icon_smile.gif )
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: Thu Jul 03, 2008 10:10 pm
Reply with quote

Maybe OP will clarify. . .

d
Back to top
View user's profile Send private message
pli guy

New User


Joined: 11 Apr 2008
Posts: 5
Location: hyderabad

PostPosted: Sat Jul 05, 2008 1:18 am
Reply with quote

hi!

the structures will be same only.... but the data in fields will be different...
i wanna compare data present and want to know where the feild mismatches....
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Jul 05, 2008 1:34 am
Reply with quote

Ecomp does the same with content of files.

like SuperC, File-Aid, Comparex, but according to some users pretty much better.
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: Sat Jul 05, 2008 2:15 pm
Reply with quote

Hello,

Quote:
i wanna compare data present and want to know where the feild mismatches....
What have you tried so far (SuperC, etc)?

Did you get the differences?

Is there some problem/question?
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 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Using Java/C/C++ to retrieve dataset ... Java & MQSeries 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Compare two files with a key and writ... SYNCSORT 3
Search our Forums:

Back to Top