IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can we eliminate duplicates in search-all


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
moore

New User


Joined: 15 Jun 2005
Posts: 11
Location: chennai

PostPosted: Wed Mar 26, 2008 4:17 pm
Reply with quote

how can we eliminate duplicates in search-all?
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Wed Mar 26, 2008 4:40 pm
Reply with quote

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
View user's profile Send private message
moore

New User


Joined: 15 Jun 2005
Posts: 11
Location: chennai

PostPosted: Wed Mar 26, 2008 4:47 pm
Reply with quote

thanks for the reply,

u mean to say, we search all won't be successful if we have duplicates?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 5:04 pm
Reply with quote

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
View user's profile Send private message
moore

New User


Joined: 15 Jun 2005
Posts: 11
Location: chennai

PostPosted: Wed Mar 26, 2008 5:50 pm
Reply with quote

r u sure about it?
if yes, how do u eliminate those duplicates using search-all?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Mar 26, 2008 5:59 pm
Reply with quote

How many entries are in the table?

Regards,

Bill
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 26, 2008 11:26 pm
Reply with quote

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
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Thu Mar 27, 2008 11:54 am
Reply with quote

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
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Mar 27, 2008 1:31 pm
Reply with quote

...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
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Thu Mar 27, 2008 10:24 pm
Reply with quote

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
View user's profile Send private message
moore

New User


Joined: 15 Jun 2005
Posts: 11
Location: chennai

PostPosted: Thu Apr 03, 2008 10:30 am
Reply with quote

thanks for all ur reply guys!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top