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
 

 

Want to remove only one duplicate record using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Mon Jun 27, 2005 9:20 am    Post subject: Want to remove only one duplicate record using DFSORT
Reply with quote

Hi folks,

My question is:
we have one dateset with duplicate records.like with the name 'babu' we have 5 records.
1.How do we eliminate duplicate records...ok...this is easy
2.i want only one duplicate record means with the name 'babu'i dont want any other records.how is it possible..............
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jun 28, 2005 2:23 am    Post subject:
Reply with quote

It's not clear what you mean by questions 1 and 2. Eliminating duplicates can mean several things.

Please show an example of your input records and what you want for output in case 1 and case 2 to clarify what you mean.
Back to top
View user's profile Send private message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Tue Jun 28, 2005 11:25 am    Post subject: my question is
Reply with quote

Hi,

My problem is:
if we have duplicate records in one file like

babu
babu
babu
babu
babu......like this

i want to copy only duplicate records first.....then i want to copy only one record instead of all duplicate records 'babu'.
Back to top
View user's profile Send private message
Hritam

New User


Joined: 27 Jun 2005
Posts: 36
Location: India

PostPosted: Tue Jun 28, 2005 12:13 pm    Post subject:
Reply with quote

Hi babu,
For the First requirement you can use the Following instruction of DSORT's ICETOOL:

1. To get all Duplicate records:

Code:

//TOOLIN   DD *                             
SELECT FROM(IN) TO(DUP) ON(P1,L1,F1) ALLDUPS
/*


2. To get the First occurance of each set of duplicate records:

Code:

//TOOLIN   DD *                             
SELECT FROM(IN) TO(DUP) ON(P1,L1,F1) FIRSTDUP
/*


If Last occurance then use LASTDUP instead of FIRSTDUP. If you want to use any more cond then you can use the USING statement also e.g

Code:

//TOOLIN   DD *                             
SELECT FROM(IN) TO(DUP) ON(P1,L1,F1) LASTDUP USING(CTL1)
/*
..
..
//CTL1CNTL   DD*
   INCLUDE COND=(........)
/*


I think this will solve your problem.

Thanks,
Hritam
Back to top
View user's profile Send private message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Tue Jun 28, 2005 12:46 pm    Post subject: Thank you
Reply with quote

Hi Hritam,

Thank you very much for ur answer.
Back to top
View user's profile Send private message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Tue Jun 28, 2005 12:49 pm    Post subject: what is P1,L1,F1
Reply with quote

Hi Hritam,

what r p1,l1,f1.if it is position,length,field.
Basically we dont know what r the duplicates we have.that time how is this possible.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jun 28, 2005 10:03 pm    Post subject:
Reply with quote

Babu,

>I want to copy only duplicate records first.....then I want to copy only one
>record instead of all duplicate records 'babu'.

Your example of 5 records with babu does not really make it clear what you want to do. With that example, copying duplicate records would be the same as copying ALL records, and copying one record would be the same as copying the first record. So I don't think that's what you really want.

If you have both duplicate and non-duplicate records in your input file, for example:

Code:

babu
babu
babu
babu
babu
cccc
dddd
dddd
eeee


then you can write just the duplicate records to OUT1 and the first record of each set of duplicates to OUT2 using a DFSORT job like this:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//TOOLIN DD *
   SELECT FROM(IN) TO(OUT1) ON(1,4,CH) ALLDUPS
   SELECT FROM(IN) TO(OUT2) ON(1,4,CH) FIRSTDUP
/*


OUT1 would have:

Code:

babu
babu
babu
babu
babu
dddd
dddd


OUT2 would have:

Code:

babu
dddd


If that's not what you want, then you need to show me a better example of your input
records and what you want for output.
Back to top
View user's profile Send private message
komal

New User


Joined: 09 May 2005
Posts: 18

PostPosted: Mon Aug 06, 2007 5:08 pm    Post subject:
Reply with quote

Hi Frank,
My shop doesn't have ICETOOL so, can we do this using DFSORT or SYNCSORT?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Aug 06, 2007 5:33 pm    Post subject:
Reply with quote

komal
1. Do you have DFSORT or SYNCSORT?
2. If not sure, then run a simple sort JOB and check your SYSOUT.
3. Did you try running Frank's solution? Did you recieve any error? If so paste the SPOOL details here.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Aug 06, 2007 8:42 pm    Post subject:
Reply with quote

Quote:
My shop doesn't have ICETOOL so, can we do this using DFSORT


If you have DFSORT, then you do have DFSORT's ICETOOL. ICETOOL has been shipped with DFSORT since 1991!
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 4 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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