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
 

 

Help Needed to Eliminate Duplicates using SORT/ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vvgoud

New User


Joined: 16 Aug 2007
Posts: 27
Location: Hyderabad

PostPosted: Tue Aug 11, 2009 8:36 pm    Post subject: Help Needed to Eliminate Duplicates using SORT/ICETOOL
Reply with quote

Hi,

I need to divide the input file into two output files
OUTPUT FILE1: Should not have duplicates
OUTPU FILE2: Should have duplicate Records
Requirement: SNO should be '1' and NAME & JOB should not duplicate)
INPUT FILE:
SNO PIC X(1)
NAME PIC X(6)
DATE PIC X(6)
JOB PIC X(3).
------------------------------
1 VENKAT 070809 MGR
1 RAJESH 080706 SSE
7 NAGESH 090808 MGR
3 SURESH 060607 SE
1 VENKAT 090807 MGR
1 RAJESH 080809 SSE
6 NAGESH 080809 MGR
9 MAHESH 080809 MGR
9 MAHESH 080809 MGR

------------------------------
OUTPUT FILE1:(No Duplicates)
------------------------------
1 VENKAT 070809 MGR
1 RAJESH 080706 SSE
7 NAGESH 090808 MGR
3 SURESH 060607 SE
6 NAGESH 080809 MGR
9 MAHESH 080809 MGR
9 MAHESH 080809 MGR

------------------------------
OUTPUT FILE2:(Duplicates)(SNO = 1 AND Same NAME & JOB should not repeat)
------------------------------
1 VENKAT 090807 MGR
1 RAJESH 080809 SSE
------------------------------


Please let me know if you need any details.

Thanks,
Goud.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Aug 11, 2009 8:58 pm    Post subject: Reply to: Help Needed to Eliminate Duplicates using SORT/ICE
Reply with quote

vvgoud,

The following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD DSN=your input file,DISP=SHR                         
//UNQ      DD SYSOUT=*                                             
//DUP      DD SYSOUT=* 
//TOOLIN   DD *                                       
  SELECT FROM(IN) TO(UNQ) ON(1,7,CH) ON(14,11,CH) -   
  FIRST DISCARD(DUP) USING(CTL1)                       
//CTL1CNTL DD *                                       
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,16,SEQNUM,8,ZD)),   
  IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),OVERLAY=(17:8C'0'))   
  OUTFIL FNAMES=UNQ,BUILD=(1,16)                       
  OUTFIL FNAMES=DUP,BUILD=(1,16)                       
/*                                                                                   
Back to top
View user's profile Send private message
vvgoud

New User


Joined: 16 Aug 2007
Posts: 27
Location: Hyderabad

PostPosted: Wed Aug 12, 2009 4:13 pm    Post subject: Reply to: Help Needed to Eliminate Duplicates using SORT/ICE
Reply with quote

Kolusu,

Thanks so much, It's working fine.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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