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
 

 

Eleminate Duplicate with Unique record.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Eleminate Duplicate with Unique record.
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    Post subject: Reply to: Eleminate Duplicate with Unique record.
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: 2276
Location: @my desk

PostPosted: Wed Jan 28, 2009 9:12 pm    Post subject:
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    Post subject: Reply to: Eleminate Duplicate with Unique record.
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    Post subject:
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: 2276
Location: @my desk

PostPosted: Thu Jan 29, 2009 1:15 pm    Post subject:
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    Post subject:
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    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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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