View previous topic :: View next topic
|
Author |
Message |
moore
New User
Joined: 15 Jun 2005 Posts: 11 Location: chennai
|
|
|
|
how can we eliminate duplicates in search-all? |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Please note the requirements for a successful SEARCH ALL:
You must have
(1) an INDEXED BY clause and the first INDEX must be used in the WHEN clause,
(2) the table in ASCENDING/DESCENDING SEQUENCE by KEY
(3) Correct WHEN construction
(4) Key values must be unique.
(5) correct OCCURS number to match valid table elements |
|
Back to top |
|
|
moore
New User
Joined: 15 Jun 2005 Posts: 11 Location: chennai
|
|
|
|
thanks for the reply,
u mean to say, we search all won't be successful if we have duplicates? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
if your table is sorted, a search all will find one of the dups. but, will not tell you which dup (could be the first or could be the second..third) |
|
Back to top |
|
|
moore
New User
Joined: 15 Jun 2005 Posts: 11 Location: chennai
|
|
|
|
r u sure about it?
if yes, how do u eliminate those duplicates using search-all? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
How many entries are in the table?
Regards,
Bill |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
if yes, how do u eliminate those duplicates using search-all?
|
You do not eliminate duplicates using search-all.
You need to load the array without duplicates. If the array contains duplicate keys and the "other" data in the duplicate(s) is not exactly the same, you may get unpredictable results. |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
dick scherrer wrote: |
Hello,
Quote: |
if yes, how do u eliminate those duplicates using search-all?
|
You do not eliminate duplicates using search-all.
You need to load the array without duplicates. If the array contains duplicate keys and the "other" data in the duplicate(s) is not exactly the same, you may get unpredictable results. |
I too agree with Dick..u can not eliminate duplicates with Searchall.
U ahve to take care of that before loading the array itself..or sort the inpuft file and remove the duplicates using DFSORT.. and then use the SORTOUT file |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
...or sort the inpuft file and remove the duplicates using DFSORT.. and then use the SORTOUT file
or Syncsort or any other tool you have in your site...or even making your program smarter to load your table. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
hi moore,
as Search-all is a binary search technique, it uses to divide the sorted array in two halves and then compares the value at the boundries until the record or end of array is not reached. if the records with duplicate is found at the left side of the boundary, it selects the first duplicate and if it is found on the right side of the boundary then it selects the second duplicate value.
in that case, you are not supposed to get a proper result with Search-All. |
|
Back to top |
|
|
moore
New User
Joined: 15 Jun 2005 Posts: 11 Location: chennai
|
|
|
|
thanks for all ur reply guys! |
|
Back to top |
|
|
|