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

How to remove Duplicates and the record also ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Wed Mar 15, 2006 4:53 pm
Reply with quote

Hi all,

I have a query,

Using XSUM i'll remove the dplicate records, and the requirement is i need to delete the that particular record also for which duplicates are present.

Ex:
Input
------------
AAABBB
CCCDDD
ABCDEF
CCCDDD
AAABBB
EEEFFF

Output:
----------
ABCDEF
EEEFFF

Hope u understood, can this be done using SYNCSORT
or any other approach is also welcome, then i have check whether that particular utility is there in my shop or not.

Thanks in Advance,
Back to top
View user's profile Send private message
martijn

New User


Joined: 09 Mar 2006
Posts: 14
Location: The Netherlands

PostPosted: Wed Mar 15, 2006 8:32 pm
Reply with quote

I don't know how to do this in one step, but, using DFSORT, i can do it in three:
step 1: add a '1' at the end of each record, so input looks like this:

AAABBB 1
CCCDDD 1
ABCDEF 1
CCCDDD 1
AAABBB 1
EEEFFF 1

Step 2: summarize on the added field, so the output looks like this:

AAABBB 2
CCCDDD 2
ABCDEF 1
EEEFFF 1

Step 3: now omit all records with a value greater the 1 on the last field, and using OUTREC, remove the last field:

ABCDEF
EEEFFF

I hope this helps. If you want, I can give you the sort-statements to do this with.
[/quote]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Mar 15, 2006 9:41 pm
Reply with quote

Quote:
I don't know how to do this in one step, but, using DFSORT, i can do it in three:


You don't need three passes to do it with DFSORT - you can do it in one pass with DFSORT's ICETOOL like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,3,CH) NODUPS
/*
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Wed Mar 15, 2006 11:30 pm
Reply with quote

Thanks a lot Frank Yaeger,

i'll try if ICETOOl is there in our shop.

Can u we do the same thing in SYNCSORT or DFSORT.

Thanks in advance...
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Mar 15, 2006 11:39 pm
Reply with quote

Gau,

I understand that you have Syncsort, not DFSORT, since you said that in your first post. I only posted the one-pass DFSORT solution to set the record straight because martijn indicated it would take three passes with DFSORT.
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Wed Mar 15, 2006 11:48 pm
Reply with quote

Thanks to both of u( Frank & martijn) for ur quick replies....
Back to top
View user's profile Send private message
Rameshs

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Thu Mar 23, 2006 12:54 pm
Reply with quote

Is there any other method to remove duplicate records without using SORT Utilities (DFSORT/SYNCSORT) ?
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top