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

Eleminate Duplicate with Unique record.


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

New User


Joined: 23 Jan 2007
Posts: 16
Location: Mysore

PostPosted: Wed Jan 28, 2009 8:31 pm
Reply with quote

Hi All,

I've one input file as below. In this file SD00-DISC-SEQ has duplicate value.

Code:

SD00-DISC-SEQ
3/NUM         
(27-29)       
10-----------
**************
          601
          602
          602
          603
          604
          604
          604
          605
          606
          607


I want only those records which has duplicate value.
Expected output would be as below.

Code:

SD00-DISC-SEQ
3/NUM         
(27-29)       
10-----------
**************
          602
          602
          604
          604
          604
         


SUM FIELDS=NONE,XSUM is to write the duplicate records into separate file. I want these duplicate record also the unique record into same file.

i'm using SYNCSORT FOR Z/OS 1.3.1

Thank,
RB
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jan 28, 2009 8:59 pm
Reply with quote

Hi,

This should help you.

Code:

//STEP0001 EXEC PGM=SYNCTOOL                   
//TOOLMSG  DD SYSOUT=*                         
//SSMSG    DD SYSOUT=*                         
//IN1      DD *                               
          601                                 
          602                                 
          602                                 
          603                                 
          604                                 
          604                                 
          604                                 
          605                                 
          606                                 
          607                                 
//OUT1     DD SYSOUT=*                         
//TOOLIN   DD *                               
 SELECT FROM(IN1) TO(OUT1) ON(11,3,ZD) ALLDUPS
/*


Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jan 28, 2009 9:12 pm
Reply with quote

rahul.banik,

For your requirement you might need to modify the SELECT statement in the job provided by ramsri like this.
Code:
//TOOLIN   DD *                               
 SELECT FROM(IN1) TO(OUT1) ON(11,3,ZD) ALLDUPS
AS
Code:
//TOOLIN   DD *                               
 SELECT FROM(IN1) TO(OUT1) ON(27,3,CH) ALLDUPS
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jan 28, 2009 9:33 pm
Reply with quote

Nice observation Arun icon_smile.gif
Back to top
View user's profile Send private message
rahul.banik

New User


Joined: 23 Jan 2007
Posts: 16
Location: Mysore

PostPosted: Thu Jan 29, 2009 12:39 pm
Reply with quote

Hi All,

Thanks for quick reply.

I've one question.

How to add multiple sort condition into ON operand?

I'm using following sort card but I got this error.

Sort card:
Code:
//TOOLIN   DD *                                                     
  SELECT FROM(SORTIN) TO(SORTOUT) ON(3,8,ZD,11,4,ZD,15,4,ZD,19,5,ZD,
                           24,2,ZD,26,1,CH,27,3,ZD) ALLDUPS         
/*


Error :

Code:
SYNCTOOL RELEASE 1.6.1 - COPYRIGHT 2007  SYNCSORT INC.               
INITIAL PROCESSING MODE IS "STOP"                                     
"TOOLIN" INTERFACE BEING USED                                         
                                                                     
  SELECT FROM(SORTIN) TO(SORTOUT) ON(3,8,ZD,11,4,ZD,15,4,ZD,19,5,ZD, 
INVALID "ON" OPERAND                                                 
OPERATION COMPLETED WITH RETURN CODE 12                               
                                                                     
PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
                                                                     
                           24,2,ZD,26,1,CH,27,3,ZD) ALLDUPS           
STATEMENT DOES NOT BEGIN WITH A VALID OPERATOR                       
                                                                     
SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 12                     
Code:
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jan 29, 2009 1:15 pm
Reply with quote

Quote:
How to add multiple sort condition into ON operand?
rahul.banik,

You need to use multiple 'ON' conditions like this.
Code:
ON(p1,l1,f1) ON(p2,l2,f2) ON(p3,l3,f3)
Back to top
View user's profile Send private message
rahul.banik

New User


Joined: 23 Jan 2007
Posts: 16
Location: Mysore

PostPosted: Thu Jan 29, 2009 3:35 pm
Reply with quote

Thanks everyone..

It's working fine.

icon_biggrin.gif icon_biggrin.gif
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 Duplicate transid's declared using CEDA CICS 3
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