I'm at home, not work. So this is "off the top of my head". But I'd look
at the INREC statement. Perhaps something along the lines of:
SORT FIELDS=...
INREC FIELDS=(1,4,
X'0001',
5)
1,4 says leave the RDW alone. If not VB, then omit this. X'0001' inserts
a 2 byte FI field with the binary value of 1. The lone 5 says to copy
the rest of the record. In this case, change the offsets by adding 2 to
what you already have for the extra 2 bytes inserted. Now include that
in the SUM
E.g.
SUM FIELDS=(7,5,PD,15,2,FI)
would become:
SUM FIELDS=(5,2,FI,9,5,PD,17,2,FI)
If you have an OUTREC, then add 2 to those offsets as well. And insert
5,2 somewhere in there as well.
Hope I was clear enough.
On Mon, 2010-10-18 at 16:49 -0600, Frank Swarbrick wrote:
> Is there any way using the SUM statement to get not only the totals but the
> total number of records that fed in to that total?
> In other words, if I have 10 records with duplicate keys totalling 500.00 I
> want to know that there were 10 (maybe put it in to a count field somewhere
> in the OUTREC).
>
> Thanks,
> Frank
>
--
John McKown
Maranatha! <><
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html