Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us