55 pts.
 Generate Totals from a printer file
We convert a spool file contaning invoices to a Physical file. Usng CL commands we write back to a spool file invoices that we want to send to the customer. Is there a easy wasy for generating totals from this spool file. I know that I can generate a Physical file from the spool file then write programs the will locate the totals, format it and generate totals, but is there a easer way ?r

Software/Hardware used:
ASKED: July 26, 2006  3:41 PM
UPDATED: July 28, 2006  2:00 AM

Answer Wiki:
One method is to create a file (or data area?) containing totals at the same time you create the invoices. Or a file containing invoice number, customer number and amount. Then your cl program can use the same search criteria on the spool file and the total file. Creating and maintaining another file can be more trouble than you want to put up with, but sometimes it's the simplest way. Or maybe you have an existing open A/R file that you can use to get the data, using the same selection criteria as for the spool files. ---Dale
Last Wiki Answer Submitted:  July 27, 2006  8:38 am  by  Dalejanus   0 pts.
All Answer Wiki Contributors:  Dalejanus   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Hmmp..if u dont have lots of users, this is what i adopted

1) give an option for user to copy spool file to 198 columns, etc out put file. teach users how to download it (u can also save the .dtf, .tto and distribute these via emails). Upload into Excel and take out all the unnecessary details by using the “Data Filter” function on Excel. then use subtotal tool on excel

2) output details to a file on as400. use query/400 to produce “totals” and output a “summary” file from query/400. very easy control both these tasks into a CL. Call RPG/SQL program to extract the requisite data and use RUNQRY! users just learn how to download their “details” and “totals file”. If data extraction is quite simple, create a CL to extract a details file and runqry to generate from detail file to a “subtotal” file. When using query/400 be careful to read the result and take out the level breaks. that is, have your record selection as,eg:(see query/400 record selection “screen” and value)

And/Or Field Test Value
BREAKLVL EQ 2

This will effectively give u a “summary file” w totals

Hope this helps?

 0 pts.