Frank Swarbuck on IBM Mainframe Discussion List <[email protected]> wrote on 10/18/2010 03:49:54 PM: > 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).
Frank, You could probably use the SECTIONS parameter of DFSORT's OUTFIL statement with TOTAL and COUNT to do what you want more easily. SECTIONS is more flexible then SUM. But if you want to do it with SUM, you can just set up a counter with a ZD 1 in it somewhere in the record and SUM that. If you want more help with this, feel free to send me the details offline (an example of your input and expected output, rules for getting from input to output, RECFM, LRECL, position, length and format of fields). Frank Yaeger - DFSORT Development Team (IBM) - [email protected] Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort ---------------------------------------------------------------------- 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

