Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Multilpe conditions in SEARCH statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Thu Sep 27, 2007 2:35 pm    Post subject: Multilpe conditions in SEARCH statement
Reply with quote

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
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Sep 27, 2007 2:49 pm    Post subject:
Reply with quote

Sunny,

One of the possible cause for S0C7 -

Quote:
Possible causes for this abend include:

Subscript error, referenced beyond table
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Sep 27, 2007 3:12 pm    Post subject:
Reply with quote

Hi Sunny,

Not clear enough.
Would you please paste the code for array delarartion & searching using code tab?
Back to top
View user's profile Send private message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Thu Sep 27, 2007 3:39 pm    Post subject: Reply to: Multilpe conditions in SEARCH statement
Reply with quote

Hello All,

Thanks for the replies.

I got the reason. I have not initialized the array.

Regards,
Sunny.
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 Sep 27, 2007 10:12 pm    Post subject:
Reply with quote

Ooops. . . icon_smile.gif

Thank you for lettng us know you have the solution.
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
This topic is locked: you cannot edit posts or make replies. Updating value of key using rewrite s... ParminderKumar COBOL Programming 4 Thu Aug 04, 2016 12:46 am
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us