Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
harithaganna,
You need a 2 level break report which needs 2 passes of data. Here is a DFSORT/ICETOOL job which would give you the desired results. I assumed that your input is FB recfm and lrecl of 80 and your data is already sorted on the keys.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=your input FB lrecl 80 bytes file,DISP=SHR
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) USING(CTL2)
//CTL1CNTL DD *
OUTFIL FNAMES=T1,REMOVECC,OVERLAY=(81:C'1'),
SECTIONS=(1,10,
TRAILER3=(1,10,2X,COUNT=(M10,LENGTH=8),81:C'0'))
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,IFOUTLEN=80,
IFTHEN=(WHEN=(81,1,ZD,EQ,0),OVERLAY=(C'SUB COUNT :')),
SECTIONS=(1,6,
TRAILER3=('TOTAL NO OF ',1,6,C' RECORDS : ',
TOT=(81,1,ZD,M10,LENGTH=8),//))
//* |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Hopefully, there are only a small number of records in the input file.
If there are hundreds of millions of records (like many of our processes), suggest the second pass is just wasted resources and some other implementation would be considered. . . |
|