Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7315

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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us