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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to extract non duplicte records from a file thru sort?
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: 1703
Location: Australia

PostPosted: Fri Apr 24, 2009 11:21 am    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Fri Apr 24, 2009 12:04 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Apr 24, 2009 12:07 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: How to extract non duplicte records from a file th
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    Post subject:
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    Post subject:
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: 500
Location: USA

PostPosted: Fri Apr 24, 2009 9:47 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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