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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
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. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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