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
 
Compare two strucures which are of 22000 chars size

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Compare two strucures which are of 22000 chars size
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

Site Director


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

PostPosted: Mon Jun 30, 2008 11:21 am    Post subject:
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    Post subject: Logic
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    Post subject: Reply to: compare two structures
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

Site Director


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

PostPosted: Wed Jul 02, 2008 12:02 am    Post subject:
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    Post subject: Reply to: compare two structures
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: 456
Location: Belgium

PostPosted: Thu Jul 03, 2008 10:55 am    Post subject:
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

Site Director


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

PostPosted: Thu Jul 03, 2008 7:02 pm    Post subject:
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: 456
Location: Belgium

PostPosted: Thu Jul 03, 2008 9:52 pm    Post subject:
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

Site Director


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

PostPosted: Thu Jul 03, 2008 10:10 pm    Post subject: Reply to: compare two structures
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    Post subject: Reply to: compare two structures
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: 456
Location: Belgium

PostPosted: Sat Jul 05, 2008 1:34 am    Post subject:
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

Site Director


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

PostPosted: Sat Jul 05, 2008 2:15 pm    Post subject:
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am

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