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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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