Sort fields= none, Last record of each group



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Sort fields= none, Last record of each group

Postby kiranmayipv » Wed Sep 22, 2010 6:38 pm

Hi,

This is the sample of an input file:
AC0000000001
AC0000000002
AC0000000003
AC0000000004
AC0000000005
ER0000000001
ER0000000002
ER0000000003
ER0000000004
ER0000000005
ER0000000006
GI0000000001
GI0000000002
GI0000000003
MN0000000001
MN0000000002
MN0000000003
MN0000000004
MN0000000005
MN0000000006
MN0000000007

I want to wite the the record with the highest count in a group to the O/p file. The expected O/p is as below :

AC0000000005
ER0000000006
GI0000000003
MN0000000007


Please advise on how the sort card needs to be written.
kiranmayipv
 
Posts: 7
Joined: Wed Aug 18, 2010 8:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort fields= none, Last record of each group

Postby skolusu » Wed Sep 22, 2010 9:33 pm

kiranmayipv,

The following DFSORT/ICETOOL JCL will give you the desired results
//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN       DD *                                           
----+----1----+----2----+----3----+----4----+----5----+---
AC0000000001                                             
AC0000000002                                             
AC0000000003                                             
AC0000000004                                             
AC0000000005                                             
ER0000000001                                             
ER0000000002                                             
ER0000000003                                             
ER0000000004                                             
ER0000000005                                             
ER0000000006                                             
GI0000000001                                             
GI0000000002                                             
GI0000000003                                             
MN0000000001                                             
MN0000000002                                             
MN0000000003                                             
MN0000000004                                             
MN0000000005                                             
MN0000000006                                             
MN0000000007                                             
//OUT      DD SYSOUT=*                                   
//TOOLIN   DD *                                           
  SELECT FROM(IN) TO(OUT) ON(1,2,CH) FIRST USING(CTL1)   
//CTL1CNTL DD *                                           
  SORT FIELDS=(1,2,CH,A,3,10,CH,D)                       
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post