Kolusu, this works well when I have records to work with, but if I have
no "D" records (sorry for the fat finger earlier...) to count or sum, I
would still like to produce a summary. There will be no DEPARTMENT rows,
but I would like to have the file name Header1, and a TOTAL line with
the 0 Articles and 0 Items.
Is this possible?
Thank you and best regards,
Billy Ashton
------ Original Message ------
From "Sri h Kolusu" <[email protected]>
To [email protected]
Date 3/28/2023 12:09:14 PM
Subject Re: DFSORT to count and sum subsets of data
Kolusu, this works great, and the end user is happy with the detail. Now, he
wants one additional tweak. The top of the file (within the first two rows) has
this:
Billy,
If your intention is to pick the 2nd or 3rd record, all you need to do is add
the sequence number to the records and then use that in WHEN=GROUP to push it
all records. The numeric validation and D record validation can also be done
on OUTFIL.
Use the control cards.(This uses the info from the 2nd record)
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(134:SEQNUM,8,ZD)),
IFTHEN=(WHEN=GROUP,BEGIN=(134,8,ZD,EQ,2),
PUSH=(143:02,44))
SORT FIELDS=(01,03,CH,A)
OUTFIL REMOVECC,NODETAIL,
INCLUDE=(19,03,FS,EQ,NUM,AND,
22,01,CH,EQ,C'D'),
HEADER1=(143,044),
SECTIONS=(01,03,
TRAILER3=(' DEPARTMENT ',
01,03,
COUNT=(M10,LENGTH=8),
' ARTICLES, TOTAL ITEMS: ',
TOT=(102,09,UFF,M10,LENGTH=12))),
TRAILER1=('*** TOTAL *** : ',
COUNT=(M10,LENGTH=8),
' ARTICLES, TOTAL ITEMS: ',
TOT=(102,09,UFF,M10,LENGTH=12))
/*
Thanks,
Kolusu
DFSORT Development
IBM Corporation
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN