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

Count of Duplicates using ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sriram_motamarri
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Mon Sep 26, 2011 5:03 pm
Reply with quote

Hi

I want the number of duplicates in a file using ICETOOL

Example:

Input file

Code:
AAAAA
AAAAA
BBBBB
CCCCC
DDDDD
DDDDD
DDDDD
EEEEEE



Output should be like

Code:
AAAAA    0002
BBBBB    0001
CCCCC   0001
DDDDD   0003
EEEEEE    0001

Can you please let me know how can I get this. Thanks!!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Sep 26, 2011 5:09 pm
Reply with quote

Maybe you can have a look at this topic and amend accordingly.
Back to top
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Mon Sep 26, 2011 5:46 pm
Reply with quote

Can you please confirm the key fields?

You last record contains 6 'E' s all others are 5?
It this a Typo?
Back to top
View user's profile Send private message
sriram_motamarri
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Mon Sep 26, 2011 5:54 pm
Reply with quote

Sorry..its a typo...
It is only five EEEEE

Keys col 1-5
Back to top
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Mon Sep 26, 2011 5:55 pm
Reply with quote

This should work: Give it a Try.

Code:

//TOOLIN   DD *                                     
  COPY FROM(IN2) TO(TEMP1) USING(CTL1)             
//CTL1CNTL DD *                                     
  INREC OVERLAY=(7:C'1')                           
  OUTFIL NODETAIL,REMOVECC,SECTIONS=(1,5,           
         TRAILER3=(1,5,7:TOT=(7,1,ZD,EDIT=(TTTT))))
Back to top
View user's profile Send private message
sriram_motamarri
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Mon Sep 26, 2011 6:07 pm
Reply with quote

Its working...
Thanks Elango...
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Sep 26, 2011 10:19 pm
Reply with quote

sriram_motamarri,

The following DFSORT JCL will give you the desired results. I assumed your data is already sorted on the key. If not then change SORT FIELDS=COPY to SORT FIELDS=(1,5,CH,A)
Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
AAAAA                                                 
AAAAA                                                 
BBBBB                                                 
CCCCC                                                 
DDDDD                                                 
DDDDD                                                 
DDDDD                                                 
EEEEE                                                 
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  OUTFIL REMOVECC,NODETAIL,                           
  SECTIONS=(1,5,TRAILER3=(1,5,X,COUNT=(M11,LENGTH=4)))
//*
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 To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top