MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

occurs class

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rakshith
Beginner


Joined: 26 Jul 2005
Posts: 32
Topics: 16
Location: bangalore

PostPosted: Thu Jan 19, 2006 1:48 am    Post subject: occurs class Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jan 19, 2006 5:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
rakshith
Beginner


Joined: 26 Jul 2005
Posts: 32
Topics: 16
Location: bangalore

PostPosted: Thu Jan 19, 2006 5:32 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jan 19, 2006 5:58 am    Post subject: Reply with quote

Quote:

plz help me


Here is your answer

http://mvsforums.com/helpboards/viewtopic.php?p=27419#27419

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Thu Jan 19, 2006 7:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group