|
One of the advantages of using RPG xTools' CpyToCSV command is that you can include column totals in the resulting CSV file. What RPG xTools does is figure out which "column" the field to be totaled corresponds to, and then insert the =sum(C3:C17) statement (with the proper column/row ranges) into the output file. Excel imports it fine and figures it out. Something like this: CPYTOCSV FILE(QGPL/CUSTSALES) + STMF('/cozzi/mystuff/sales.csv') + COLFUNC((SUM SALES)) If you don't have RPG xTools, you may want to do something similar using your own tools. -Bob Cozzi www.iSeriesTV.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of steema@xxxxxxxxxxxxx Sent: Monday, July 03, 2006 8:29 AM To: RPG programming on the AS400 / iSeries Subject: Totals for a file to Excel HI I have an old RPG program that creates a work file. I have to get this file into excel but also the user wants me to provide various totals. Rather than do this in excel i want to send the file to excel w/ the totals already in. I am having trouble gettting totals to the work file via the cycle so thought to either write my own little RPG to do so, or perhaps to use Query or SQL. So far in Query the totals are not showing. Not sure how this works in SQL. Or is there a better way via Client Access. The thing is, I found a tool we have here that does the excel part. Thanks, Steve
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.