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

How to extract non duplicte records from a file thru sort?


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

New User


Joined: 31 May 2007
Posts: 19
Location: Chennai

PostPosted: Fri Apr 24, 2009 11:02 am
Reply with quote

Hi,
How to extract non duplicte records from a file thru sort?
If we use SUM FIELDS=NONE, The result will contain one record of the duplicates. My requirement is to extract only non duplicate records ie if duplicate is there for a record then that record should not be there in the output.
Thanks,
raam
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Apr 24, 2009 11:21 am
Reply with quote

Hi,

I'm sure there are many examples in the forum, but it's Friday afternoon
and in a good mood

here is an example
Code:
//STEP0001 EXEC PGM=SYNCTOOL                             
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN       DD *                                           
1                                                         
1                                                         
2                                                         
//NODUPS   DD SYSOUT=*                                   
//TOOLIN   DD *                                           
SELECT FROM(IN) TO(NODUPS) ON(1,1,CH) NODUPS             
/*             
                                       


Gerry
Back to top
View user's profile Send private message
raam2smart

New User


Joined: 31 May 2007
Posts: 19
Location: Chennai

PostPosted: Fri Apr 24, 2009 11:47 am
Reply with quote

Thanks Gerry!!!
Is is possible in Syncsort. I'll try getting it from the forum meanwhile if anyone can help me on this, that will be really great.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Apr 24, 2009 12:04 pm
Reply with quote

And if you are looking for something else (and not the one which Gerry has shown which is actually in the close proximity per the problem description); please post some sample input, expected output along with their LRECL & RECFM.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Apr 24, 2009 12:07 pm
Reply with quote

Quote:
meanwhile if anyone can help me on this
icon_confused.gif . . . did you try the solution from Gerry?
Back to top
View user's profile Send private message
raam2smart

New User


Joined: 31 May 2007
Posts: 19
Location: Chennai

PostPosted: Fri Apr 24, 2009 12:24 pm
Reply with quote

No. We dont have ICETOOL utility to run this? Can this possible in syncsort?
Back to top
View user's profile Send private message
raam2smart

New User


Joined: 31 May 2007
Posts: 19
Location: Chennai

PostPosted: Fri Apr 24, 2009 12:26 pm
Reply with quote

Is it possibel to do this in a sort and not thru SYNCTOOL or ICETOOL?
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Fri Apr 24, 2009 12:33 pm
Reply with quote

Raam,
I have used the same condition SUM FIELDS=NONE using SYNCSORT utility and its working fine for me.
Quote:

If we use SUM FIELDS=NONE, The result will contain one record of the duplicates. My requirement is to extract only non duplicate records ie if duplicate is there for a record then that record should not be there in the output.

If a Dataset has 22
22 as input
then output will be 22 if we use the above condition
Back to top
View user's profile Send private message
raam2smart

New User


Joined: 31 May 2007
Posts: 19
Location: Chennai

PostPosted: Fri Apr 24, 2009 12:40 pm
Reply with quote

Ok. Ill explain clearly.

Assume the input file contains the following records.
AAAAA
BBBBB
CCCCC
DDDDD
AAAAA
CCCCC

My output file should contain the following records.
BBBBB
DDDDD

How can we achive this?
Back to top
View user's profile Send private message
raam2smart

New User


Joined: 31 May 2007
Posts: 19
Location: Chennai

PostPosted: Fri Apr 24, 2009 12:41 pm
Reply with quote

If there is duplicates, I dont want even a single record from the duplicates?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Apr 24, 2009 9:47 pm
Reply with quote

Try this SyncSort for z/OS 1.3 application:
Code:
//SORT  EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*           
//SORTOUT DD SYSOUT=*                               
//SORTIN  DD *                                         
AAAAA                                                 
BBBBB                                                 
CCCCC                                                 
DDDDD                                                 
AAAAA                                                 
CCCCC                                                                   
//SYSIN   DD *                                       
   INREC FIELDS=(1:C'001',1,5)                       
   SORT FIELDS=(4,5,CH,A)                             
   DUPKEYS SUM=(1,3,ZD)                               
   OUTFIL OUTREC=(1:4,5),INCLUDE=(1,3,CH,EQ,C'001')   
/*
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 FTP VB File from Mainframe retaining ... JCL & VSAM 2
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top