I just needed a quick and dirty program to tell me how many "duplicate" records were in a file. I ended up doing something else, though I've already forgotten what! But I will review your ideas more thoroughly later. Thanks! Frank
On 10/19/2010 at 10:57 AM, in message <of34d2219c.e1986267-on882577c1.005ce6a8-882577c1.005d3...@us.ibm.com>, Frank Yaeger <[email protected]> wrote: > 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 >>> The information contained in this electronic communication and any document attached hereto or transmitted herewith is confidential and intended for the exclusive use of the individual or entity named above. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any examination, use, dissemination, distribution or copying of this communication or any part thereof is strictly prohibited. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy this communication. Thank you. ---------------------------------------------------------------------- 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

