Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Hi.
i have a 200 byte flat file that I need to get the invoice amount summarized for each vendor that exists on the file and also need to count the number of records each vendor has as well as grand totals.
With the DISPLAY Operand ( and DFSort ) I can get the vendor amounts rolled up with each vendor but I cannot see how I can get the number of records count. I thought I saw something out here a while back to do a similiar thing but cannot find the post. A cobol program will do this in a snap I know, but similiar reports come over often during this conversion.
Once I have a model I will be cranking them out lickety split with this tool I believe.
These are the 2 inputs I am working with:
05 VENDOR-NUMBER PIC X(07).
05 NET-AMOUNT PIC S9(09)V99 VALUE 0.
And the requested output should be similiar to this:
Vendor No. of invoices Total net amount
A123456 7 $47,322.98
A123457 2 $100.00
A123458 27 $227,005.09
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Why can't you use the BCOUNT operand of DISPLAY to get the break counts and the COUNT operand of DISPLAY to get the file count?
Note that if it's a matter of how you want the output formatted vs how DISPLAY formats it, then you probably need to use OUTFIL for the report rather than DISPLAY to get that level of control of the formatting.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
ok. thanks frank. i checked those and those operands worked for what I was looking for. The problem with using those for I had to get done was I couldn't suppress the line item display and just retain the BCOUNT Tots and money summary. So I went in at that sorta backwards but it worked nonetheless.
I did the following to summarize the data first:
Then I let ICETOOL do some work. i stated that the counter field coming in was numeric so I got Grand Totals on that as well as well as my Net Amounts.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
thats what happened. i didnt use the code tag. and yes it does help because the data was left justified in my post. thanks Dick.
now, where is that little tag anyway.....hmmmm.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
madmartinsonxx,
Instead of using two passes with OUTFIL and DISPLAY, why not just add TRAILER1 to OUTFIL to get what you want in one pass? TRAILER3 is the section trailer. TRAILER1 is the report trailer (overall count and totals).