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 

Counts thru SORT

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


Joined: 25 Jan 2007
Posts: 40
Topics: 17

PostPosted: Mon Sep 24, 2007 10:59 am    Post subject: Counts thru SORT Reply with quote

Hi All,

I need help to find the counts for the following input.

Code:
----+----1----+----2----+----3
EFG 123 A          01300       
ERE 234 A          01300       
SAF 123 C          01400       
FDG 135 B          01400       
SDF 123 B          01300       
DSD 234 A          01500       
CSC 123 B          01300       
SAE 123 C          01500       
DSD 135 B          01400       
CSC 123 B          01300       


I want the counts like howmany 01300 for A and howmany 01300 for B...etc. The possible values are A,B and C only. I want the o/p like below.
Code:

01300   A   2
01300   B   3
01400   B   2
01400   C   1
01500   A   1
01500   C   1


Thanks for your help as always.
SK2007.
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: Mon Sep 24, 2007 11:26 am    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=*                                 
//IN DD *                                 
EFG 123 A          01300                             
ERE 234 A          01300                             
SAF 123 C          01400                             
FDG 135 B          01400                             
SDF 123 B          01300                             
DSD 234 A          01500                             
CSC 123 B          01300                             
SAE 123 C          01500                             
DSD 135 B          01400                             
CSC 123 B          01300                             
//RPT DD SYSOUT=*                                     
//TOOLIN   DD    *                                   
OCCUR FROM(IN) LIST(RPT) NOHEADER BLANK -             
  ON(20,5,CH) ON(9,1,CH) ON(VALCNT,U02)               
/*                                                   

_________________
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
SK2007
Beginner


Joined: 25 Jan 2007
Posts: 40
Topics: 17

PostPosted: Mon Sep 24, 2007 2:18 pm    Post subject: Reply with quote

Thanks Frank,

It is working as expected.

Regards
SK2007.
Back to top
View user's profile Send private message
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