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
 
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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm

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