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 

Is SEARCH verb (subscript) handle multiple conditions (AND..

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


Joined: 14 May 2006
Posts: 40
Topics: 18

PostPosted: Wed May 28, 2008 1:38 pm    Post subject: Is SEARCH verb (subscript) handle multiple conditions (AND.. Reply with quote

Hi,

For my current assingment ,

I have to push a value if that x, y lies in between Min , Max of X & Y.


X & Y , are populated to internal Data Layer (DB2 pgm) to a internal table.

struct of internal table is

03 TABLE OCCURS 1000 TIMES.
05 X PIC ..
05 Y PIC ..


---

In the above is Internal table suits or ?

when compiling my code , i am getting error in

Invalid WHEN cond in SEARCH

- Because i used to compare XM <= x => XL & same as Y (X M-Max, L - Least)


SEARCH TABLE
AT END imperative stmt
WHEN
f1(subscript) >= fetched db2 value AND |
f1(subscript) <= fetched db2 value AND |- x
z1(subscript) >= fetched db2 value AND|
z1(subscript) >= fetched db2 value AND |- y

....

is multiple conditions are allowed in Search critiria ?



Please suggest me some way. Your inputs are appreciated....

Very Happy
_________________
Thanks&Regards
Prasanth Thavva
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu May 29, 2008 11:46 am    Post subject: Reply with quote

prasanth_thavva,

Try this

Code:

SEARCH <your internal table>
    AT END
       code eof table logic
   WHEN ELEMENT-1(IDX) = cond 1
    AND ELEMENT-2(IDX) = cond 2
    AND ELEMENT-3(IDX) = cond 3
        your logic here     
END-SEARCH.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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