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
 
SEARCH ALL result when the input data is not sorted

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

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Fri Apr 13, 2007 4:07 pm    Post subject: SEARCH ALL result when the input data is not sorted
Reply with quote

I am using SEARCH ALL in one of my program. For SEARCH ALL, the data should be in Ascending or decending order. I just want to know, if we dont sort the data, will we get any error or the SEARCH ALL does not function properly.
Back to top
View user's profile Send private message

dnreddy

New User


Joined: 08 Dec 2006
Posts: 8
Location: chennai

PostPosted: Fri Apr 13, 2007 4:37 pm    Post subject: I am using SEARCH ALL in one of my program. For SEARCH ALL,
Reply with quote

Hi ravi

SEARCH - is a serial search.

SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL.

What should be the sorting order for SEARCH ALL
It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).

Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Fri Apr 13, 2007 4:42 pm    Post subject:
Reply with quote

I know that. My question is, suppose if the data is not sorted, will we get error.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Apr 13, 2007 4:42 pm    Post subject:
Reply with quote

From the Language Reference
Quote:
The results of a SEARCH ALL operation are predictable only when:
v The data in the table is ordered in ASCENDING/DESCENDING KEY order
v The contents of the ASCENDING/DESCENDING keys specified in the WHEN clause provide a unique table reference.
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: Fri Apr 13, 2007 6:54 pm    Post subject:
Reply with quote

Hello,

Follow the Search rules or possibly get invalid results - it may not actually fail, just give the wrong result. There is no suppose the data is not sorted.
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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