View previous topic :: View next topic
|
Author |
Message |
sunnybunny
New User
Joined: 29 Nov 2005 Posts: 49
|
|
|
|
Hello Friends,
I would like to execute a SEARCH statemnt with multiple conditions.
For that I have written a code as below.
SEARCH CHECK-DUP-EMPLOYEE VARYING S-SUB2
AT END
CONTINUE
WHEN EMPLOYEENUMBER IN CHECK-DUP-EMPLOYEE (S-SUB2) =
WS-EMPLOYEENUMBER
AND EMPLOYEETYPE IN CHECK-DUP-EMPLOYEE (S-SUB2) = 16
SET ISK-EMP-FND TO TRUE
END-SEARCH.
For this code what is happening is, let us say there are 5 employeenumbers in array. So now let us say the value of WS-EMPLOYEENUMBER is 3 and I am searching for this in internal array.
Here my requirement is I have to take the records from internal array which are having WS-EMPLOYEENUMBER is 3 and EMPLOYEETYPE is 16.
But whats happening is for given WS-EMPLOYEENUMBER array is executing for 5 times (because in array total number of EMPLOYEENUMBER are 5) without checking the AND condition. After it has executed 5 times subscript is incrementing to 6 and then abending with SOC7.
Please let me know how to handle this.
Regards,
Sunny. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Sunny,
One of the possible cause for S0C7 -
Quote: |
Possible causes for this abend include:
Subscript error, referenced beyond table |
|
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Sunny,
Not clear enough.
Would you please paste the code for array delarartion & searching using code tab? |
|
Back to top |
|
|
sunnybunny
New User
Joined: 29 Nov 2005 Posts: 49
|
|
|
|
Hello All,
Thanks for the replies.
I got the reason. I have not initialized the array.
Regards,
Sunny. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Ooops. . .
Thank you for lettng us know you have the solution. |
|
Back to top |
|
|
|