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
 
Could you please give me example of 'SEARCH ALL' Statement

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

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Wed Sep 24, 2008 7:04 pm    Post subject: Could you please give me example of 'SEARCH ALL' Statement
Reply with quote

Hi,

I'm expecting example of 'SEARCH ALL' Statement with description.

Thanks,
Amol Londhe
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Sep 24, 2008 7:53 pm    Post subject:
Reply with quote

look at this one
Code:

01 DESC.                                               
   02 ARR PIC X(26) VALUE 'ABCDEFGHIJKLMNOPQRSHUVWXYZ'.
   02 ARR1 REDEFINES ARR PIC X(1) OCCURS 26 TIMES     
                              ASCENDING KEY IS ARR1   
                              INDEXED BY IDX.         
.
.
    SET IDX TO 1.                                     
    SEARCH ALL ARR1 AT END DISPLAY 'LETTER NOT FOUND'
    WHEN ARR1(IDX) = 'H'                             
    SET POS TO IDX                                   
    DISPLAY 'LETTER IS FOUND AT: '  POS               
    END-SEARCH.                                       
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Sep 24, 2008 8:02 pm    Post subject:
Reply with quote

Sorry one correction to string value
Change string value to 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' replace second H by T and run.

while doing comparision
for first time 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

2nd time 'ABCDEFGHIJKLM'

3rd time 'GHIJKLM'
And so on.. GHI...AND H FINALLY
Back to top
View user's profile Send private message
kalpana manoharan84
Currently Banned

New User


Joined: 18 Sep 2008
Posts: 4
Location: Chennai

PostPosted: Wed Sep 24, 2008 8:11 pm    Post subject: Reply to: Could you please give me example of 'SEARCH ALL' S
Reply with quote

Hi,
when using SEARCH ALL verb, its not mandatory to set the Index variable -IDX [given in the example code] to an initial value.

Please note the requirements for a successful SEARCH ALL:
1] Internal Table should be in sorted ASCENDING/DESCENDING
SEQUENCE by KEY
2] Key values must be unique
3] Table must have a KEY IS clause in addition to an INDEXED BY clause
4] OCCURS (n) TIMES should match valid table elements

Hope this might be helpful.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Sep 24, 2008 8:19 pm    Post subject:
Reply with quote

Hi,

Please search the forum before posting, here are some similar topics:

http://www.ibmmainframes.com/viewtopic.php?t=33202&highlight=search
http://www.ibmmainframes.com/viewtopic.php?t=32772&highlight=search
http://www.ibmmainframes.com/viewtopic.php?t=29907&highlight=search
http://www.ibmmainframes.com/viewtopic.php?t=28869&highlight=search
http://www.ibmmainframes.com/viewtopic.php?t=29377&highlight=search
http://www.ibmmainframes.com/viewtopic.php?t=28520&highlight=search
http://www.ibmmainframes.com/viewtopic.php?t=26256&highlight=search
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 COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
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

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