Yes, you can make this type of output with DFSORT.

DFSORT has "reporting features" on OUTFIL. This provides SUBTOT/SUBTOTAL, which 
is to provide running-totals.

SUBTOTAL is available on TRAILER1, TRAILER2 and TRAILER3. None of which do 
exactly what you want. If you look at what each does you'll pick TRAILER3 as 
the most likely.

TRAILER3 operates by providing a "total line" on a control-break defined with 
SECTIONS.

You don't have anything likely-looking which is going to securely produce a 
control-break for each record. So you make one.

You use INREC with OVERLAY (for fixed-length records (with variable-length 
records, prepend with BUILD instead) to append a SEQNUM to each record. Note 
that all you need is to guarantee that somewhere on the current record has a 
value which is different from the previous record. So, a SEQNUM with a length 
of one is fine.

SUBTOTAL only understands directly numeric data-types, so you need some 
additional preparation of those two items which are not numeric (although you'd 
get away with the first). This you can prepare with OVERLAY, doing a 
"conversion" (you can use TO= with LENGTH= or EDIT=). You'll need to look at 
data-types, and probably use CSF/FS and UFF. If your number of decimal places 
is not fixed, you'll need some extra.

On the TRAILER3 you include the original data, then the two SUBTOTALs. There 
are standard widths (8 and 15) or you can provide your own specific widths and 
formatting (you'll need to use EDIT to get your "." before a single decimal 
place).

Then, since "reporting features" produce reports, you'll need some things on 
OUTFIL. You don't want Carriage Control characters, so use REMOVECC. It is only 
the totals you want, so NOTDETAIL.

I'm sure there are examples out there, but you'll pick up a lot if you go 
through the above with the manual.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to