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
 
How can we eliminate duplicates in search-all

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How can we eliminate duplicates in search-all
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: 171
Location: Bangalore

PostPosted: Wed Mar 26, 2008 4:40 pm    Post subject: Reply to: search all
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    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 5:04 pm    Post subject:
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    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Mar 26, 2008 5:59 pm    Post subject: How can we eliminate duplicates in search-all
Reply with quote

How many entries are in the table?

Regards,

Bill
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: Wed Mar 26, 2008 11:26 pm    Post subject:
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: 215
Location: India

PostPosted: Thu Mar 27, 2008 11:54 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 TBSARG - Deleting the search criteria... ISPFHerc TSO/ISPF 5 Thu Dec 14, 2017 8:18 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 Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm

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