View previous topic :: View next topic |
Author |
Message |
SK2007 Beginner
Joined: 25 Jan 2007 Posts: 40 Topics: 17
|
Posted: Mon Sep 24, 2007 10:59 am Post subject: Counts thru SORT |
|
|
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 |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Sep 24, 2007 11:26 am Post subject: |
|
|
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 |
|
 |
SK2007 Beginner
Joined: 25 Jan 2007 Posts: 40 Topics: 17
|
Posted: Mon Sep 24, 2007 2:18 pm Post subject: |
|
|
Thanks Frank,
It is working as expected.
Regards
SK2007. |
|
Back to top |
|
 |
|
|