Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Hmmm ... this is a tough one. The DFSORT job below will get you the two parts of the report as two different output files, but I can't figure out how to stitch them together the way you want them. You could, of course, copy and paste.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,REMOVECC,
BUILD=(SEQNUM,1,ZD,RESTART=(5,2),22:8,9),
SECTIONS=(5,2,
HEADER3=('Branch ',5,2),
TRAILER3=('Total: ',COUNT=(M11,LENGTH=1),/,
'------------------------------'))
OUTFIL FNAMES=OUT2,REMOVECC,NODETAIL,
HEADER2=(13:'Branch/Region',40:'Total'),
SECTIONS=(1,2,
TRAILER3=(13:'Region',20:1,2,
40:COUNT=(M10,LENGTH=5),/,
'----------------------------------------------------'),
5,2,
TRAILER3=(13:'Branch',20:5,2,
40:COUNT=(M10,LENGTH=5)))
/*
|
|
|
reddy_prn
New User
Joined: 15 Feb 2007 Posts: 8 Location: India
|
|
|
|
My input files is :
First 2 bytes - Region code
Next 2 bytes - Branch code
Then, Data starts for each record.
In the same region different branches can be present but vice versa is not true. There can be more than one record for each branch in the input file, but data will be different in all these records although they are from the same branch.
The input file is sorted on region and then on branch.
For every brach change, i need a report and for every region change i need a report.
Please let me know if you need additional information from me. |
|