MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get the count of similar records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Jan 26, 2012 10:27 am    Post subject: Get the count of similar records Reply with quote

Hi,

I want to display the count of similar records from the file. Like in the input we have three records with 0001 in pos 1 same way i want the count for all the records with same value in pos 1.

[Input File]

0001 Siva
0001 Ram
0001 Tulasi
0002 Rahul
0002 Ranjeet
0003 Shart

[Output]

0001 3
0002 2
0003 1


Thanks,
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Jan 26, 2012 12:40 pm    Post subject: Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL                                           
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//SYSUDUMP DD SYSOUT=*                                               
//IN DD *                                                           
0001     Siva                                                       
0001     Ram                                                         
0001    Tulasi                                                       
0002    Rahul                                                       
0002    Ranjeet                                                     
0003    Shart                                                       
//OUT DD SYSOUT=*                                                   
//TOOLIN DD *                                                       
OCCUR FROM(IN) LIST(OUT) ON(1,4,CH) ON(VALCNT) NOHEADER NOCC BLANK   
/*


For complete details on the OCCUR operator of DFSORT's ICETOOL, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/7.11?DT=20110608113434
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group