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

Help Needed to Eliminate Duplicates using SORT/ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top