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
 

 

Count of Duplicates using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Count of Duplicates using ICETOOL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Mon Sep 26, 2011 5:09 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Count of Duplicates using ICETOOL
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    Post subject:
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    Post subject: Reply to: Count of Duplicates using ICETOOL
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    Post subject: Reply to: Count of Duplicates using ICETOOL
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    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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am


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