View previous topic :: View next topic |
Author |
Message |
rakshith Beginner
Joined: 26 Jul 2005 Posts: 32 Topics: 16 Location: bangalore
|
Posted: Thu Jan 19, 2006 1:48 am Post subject: occurs class |
|
|
Hi all I have doubt regarding checking conditions for occurs class.
Variables goes like below.
Code: |
Group1.
01 A pic x(2).
01 B pic x(2).
01 C pic x(2).
01 group.
05 G1 occurs 3 time pic x(1).
05 G2 occurs 3 time pic x(1).
05 G3 occurs 3 time pic x(1).
01 D pic x(3).
01 E pic x(2).
Group2.
01 A PIC x(2).
01 B pic x(2).
01 C pic x(2).
01 group.
05 G1 occurs 3 time pic x(1).
05 G2 occurs 3 time pic x(1).
05 G3 occurs 3 time pic x(1).
01 D pic x(3).
01 E pic x(2).
|
condition.
if any of the fields in group1 not = to fields in group2, we have perform some error routine.
how can I check not = condition for both occurs class field and normal fields in the same time.
thanks
rakshith |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Jan 19, 2006 5:21 am Post subject: |
|
|
rakshith,
Assuming that you have defined the group1/2 at 01 level, a simple cond like this will do
Code: |
IF GROUP1 NOT = GROUP2
CALL ERROR ROUTINE
END-IF
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
rakshith Beginner
Joined: 26 Jul 2005 Posts: 32 Topics: 16 Location: bangalore
|
Posted: Thu Jan 19, 2006 5:32 am Post subject: |
|
|
The correct fields with level numbers are as follows.
05 Group1.
10 A pic x(2).
10 B pic x(2).
10 C pic x(2).
10 group.
15 G1 occurs 3 time pic x(1).
15 G2 occurs 3 time pic x(1).
15 G3 occurs 3 time pic x(1).
05 D pic x(3).
05 E pic x(2).
plz help me |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
German Castillo Beginner

Joined: 23 Dec 2005 Posts: 83 Topics: 2 Location: Caracas, Venezuela
|
Posted: Thu Jan 19, 2006 7:47 am Post subject: |
|
|
I don't seem to understand your request clearly, anyway I would try to make the fields the same size and do a simple comparison, something like
Code: |
10 group.
11 GG1.
15 G1 occurs 3 time pic x(1).
11 GG2.
15 G2 occurs 3 time pic x(1).
11 GG3.
15 G3 occurs 3 time pic x(1).
....
If A = GG1 AND B = GG2 AND C = GG3
...
|
_________________ Best wishes,
German Castillo |
|
Back to top |
|
 |
|
|