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
 
Will SEARCH ALL terminate after finding the first value

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

New User


Joined: 21 Sep 2006
Posts: 15
Location: india

PostPosted: Mon Nov 06, 2006 8:42 am    Post subject: Will SEARCH ALL terminate after finding the first value
Reply with quote

Hi All,

If i am searching a table with a Search All for on a field agent _no and there are two occurences of the value will search all terminate after finding the first value?
If i want to fetch the second value also what should i do.
Back to top
View user's profile Send private message

premnath.mls

New User


Joined: 16 Aug 2006
Posts: 9

PostPosted: Mon Nov 06, 2006 9:04 am    Post subject:
Reply with quote

haI..

you can include the ssearch all atatement within the perform statement...by this allow ,your search to the all occurences.

i hope you got the point ..

if you need a logic, bring back to me...
Back to top
View user's profile Send private message
guptae

Moderator


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

PostPosted: Mon Nov 06, 2006 12:32 pm    Post subject:
Reply with quote

Hi There,

Code:
05 WS-TABLE OCCURS 1 TO 100 TIMES     
                    ASCENDING KEY IS AGENT-NO     
                   INDEXED BY TABLE-IDX. 
    10  AGENT-NO         PIC X(10).       

PERFORM TABLE UNTIL COUNT >= 2
   SEARCH ALL
        WHEN AGENT-NO(TABLE-INDX) = STRING
                  ADD 1             TO COUNT
   END-SEARCH
   SET  TABLE-IDX          UP BY 1
END-PERFORM.

Hope this will helpful.
Back to top
View user's profile Send private message
mull

New User


Joined: 21 Sep 2006
Posts: 15
Location: india

PostPosted: Tue Nov 07, 2006 7:27 pm    Post subject:
Reply with quote

Thanks for the help
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 LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 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 Finding IMS resource blocker after se... Hooman24 IMS DB/DC 1 Wed Aug 16, 2017 9:17 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm

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