|
View previous topic :: View next topic
|
| Author |
Message |
madmartinsonxx
New User

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
Grand total 36 $6,774,398.10
thanks in advance and happy new year |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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. |
|
| Back to top |
|
 |
madmartinsonxx
New User

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:
| Code: |
000077 //SYSIN DD *
000078 SORT FIELDS=(21,7,CH,A)
000079 OUTFIL REMOVECC,NODETAIL,
000080 SECTIONS=(21,7,
000081 TRAILER3=(21,7,' ',COUNT=(EDIT=(IIII)),
000082 ' ',TOTAL=(092,11,ZD,EDIT=(III,III,III,IIT.TT)))) |
Output looks like this but right justified:
| Code: |
A042300 1 3,630.00
A074845 1 856.00
A074922 4 10,420.72
A074937 1 1,310.00 |
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.
| Code: |
//TOOLIN DD *
MODE STOP
DISPLAY FROM(INPUT) LIST(APDMS01) -
TITLE('APDMS VENDOR INVOICE BREAKDOWN') PAGE -
DATE -
TIME -
HEADER('VENDOR ') -
HEADER(' INVOICE COUNT ') -
HEADER('NET AMOUNT ') -
ON(1,07,CH) ON(08,05,SFF,U05) -
ON(013,19,SFF,C1,U14,F'$') -
TOTAL('TOTALS ') -
COUNT('TOTAL COUNT OF VENDORS IN FILE')
/* |
output looks like but right justified ! ( geez ) :
| Code: |
VENDOR INVOICE COUNT NET AMOUNT
------- --------------- --------------------
99325A0 1 $130.30
9940310 1 $922.35
9947280 2 $34,778.65
99625A0 1 $100.00
9968090 2 $278.99
9971830 3 $11,500.00
9973520 1 $3,012.00
99750A0 2 $33,206.80
9976750 2 $11,675.15
9981970 1 $998.30
9982710 1 $15,000.00
99973A0 8 $5,035.43
TOTALS 17449 $123,159,324.81 |
Now if i can just figure out how to format output to exactly what I want it to be. I am going there next.
Thanks again to your team. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Well, i'm lost. . . When "Code'd", the data appears to be right-justified - which is how nearly all business data is presented. . .
Suggest you practice using the "Code" tag so that your posts will be aligned and more readable.
Possibly, there is something i've misunderstood. |
|
| Back to top |
|
 |
madmartinsonxx
New User

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. |
|
| Back to top |
|
 |
madmartinsonxx
New User

Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
|
|
|
|
| Code: |
//TOOLIN DD *
MODE STOP
DISPLAY FROM(INPUT) LIST(APDMS01) -
TITLE('APDMS VENDOR INVOICE VALIDATION') PAGE -
DATE -
TIME -
HEADER('VENDOR ') -
HEADER(' INVOICE COUNT ') -
HEADER('NET AMOUNT ') -
ON(1,07,CH) ON(08,05,SFF,U05) -
ON(013,19,SFF,C1,U14,F'$') -
TOTAL('TOTALS ') -
COUNT('TOTAL COUNT OF VENDORS IN FILE')
|
|
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
There ya go. . .
It couldn't hide for long. . .
d |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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). |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|