 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to get a total of amount field in RPGLE code</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 18:24:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109418</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Fri, 20 Jul 2012 23:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109418</guid>
		<description><![CDATA[&lt;i&gt;Notice the total on this desired outputl&lt;/i&gt;Ah, yes. Previously his output was showing a &quot;running total&quot;. At first it looked like...Well, never mind what it looked like. It&#039;s hard to be sure if it&#039;s making better sense to me now, but I&#039;ll assume it is. In essence, all he wants is a simple summary report.So, again it looks like a simple view with a GROUP BY and a SUM(SCBALL) for each group would provide the values.In pure RPG, with his group fields for the only level break, it would only print the L1 totals to get the report he wants. And your sample code would mostly be fine if full-procedural is the desired method.Everything would be easier to make sense of if formatting would work predictably.Tom]]></description>
		<content:encoded><![CDATA[<p><i>Notice the total on this desired outputl</i>Ah, yes. Previously his output was showing a &#8220;running total&#8221;. At first it looked like&#8230;Well, never mind what it looked like. It&#8217;s hard to be sure if it&#8217;s making better sense to me now, but I&#8217;ll assume it is. In essence, all he wants is a simple summary report.So, again it looks like a simple view with a GROUP BY and a SUM(SCBALL) for each group would provide the values.In pure RPG, with his group fields for the only level break, it would only print the L1 totals to get the report he wants. And your sample code would mostly be fine if full-procedural is the desired method.Everything would be easier to make sense of if formatting would work predictably.Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109403</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Fri, 20 Jul 2012 11:37:17 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109403</guid>
		<description><![CDATA[Tom
&#160;
6785762.20- &#124; EGP JB 307
&#160;
Notice the total on this desired outputl
Phil]]></description>
		<content:encoded><![CDATA[<p>Tom<br />
&nbsp;<br />
6785762.20- | EGP JB 307<br />
&nbsp;<br />
Notice the total on this desired outputl<br />
Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109397</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Fri, 20 Jul 2012 03:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109397</guid>
		<description><![CDATA[Sigh. So much for useful formatting.
&#160;
Tom]]></description>
		<content:encoded><![CDATA[<p>Sigh. So much for useful formatting.<br />
&nbsp;<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109396</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Fri, 20 Jul 2012 03:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109396</guid>
		<description><![CDATA[A few lines from the suggested code bring a question:* now process current record
Eval TotalBall = TotalBall + SCBALL
...

*.
Begsr PrintLn
If TotalBal &gt; 0
Write TotalLn &lt;== print fields holdACT, HoldSCAPP, TotalBal
Why would TotalLn include TotalBal in the output? From the supplied examples, what should be printed is SCBALL from the last record in the group. No?
&#160;
Tom
&#160;
(And if this comes out looking anything like what I attempted, I&#039;ll be pleasantly surprised.)]]></description>
		<content:encoded><![CDATA[<p>A few lines from the suggested code bring a question:* now process current record<br />
Eval TotalBall = TotalBall + SCBALL<br />
&#8230;</p>
<p>*.<br />
Begsr PrintLn<br />
If TotalBal &gt; 0<br />
Write TotalLn &lt;== print fields holdACT, HoldSCAPP, TotalBal<br />
Why would TotalLn include TotalBal in the output? From the supplied examples, what should be printed is SCBALL from the last record in the group. No?<br />
&nbsp;<br />
Tom<br />
&nbsp;<br />
(And if this comes out looking anything like what I attempted, I&#8217;ll be pleasantly surprised.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109392</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Thu, 19 Jul 2012 23:30:50 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109392</guid>
		<description><![CDATA[The big challenge here was trying to find something interesting to do with the words total and amount.&#160; Although, I found a few quotes, they didn&#039;t appeal to me, so I just went with total and found&#160;this quote.
&quot;I&#039;ve had great success being a total idiot.&quot; Jerry Lewis]]></description>
		<content:encoded><![CDATA[<p>The big challenge here was trying to find something interesting to do with the words total and amount.&nbsp; Although, I found a few quotes, they didn&#8217;t appeal to me, so I just went with total and found&nbsp;this quote.<br />
&#8220;I&#8217;ve had great success being a total idiot.&#8221; Jerry Lewis</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109391</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Thu, 19 Jul 2012 23:12:10 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109391</guid>
		<description><![CDATA[It&#039;s unusual for us to provide code .. but there was a great deal of effort on your part.&#160; This code has not been compiled or tested.&#160;
Phil&#160;]]></description>
		<content:encoded><![CDATA[<p>It&#8217;s unusual for us to provide code .. but there was a great deal of effort on your part.&nbsp; This code has not been compiled or tested.&nbsp;<br />
Phil&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109390</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Thu, 19 Jul 2012 23:08:01 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109390</guid>
		<description><![CDATA[So, every time you see a new SCACT you&#039;ll have 
a total to print (provided it&#039;s not zero)

Very easy, should have been part of your logic class.

Except I don&#039;t know where you&#039;re getting the EUR from
 or why you want to print the 003 or 002 from the last record.

There seems to be a little problem with the columns, 
I assume that 003 comes from SCAPP the 
others that I want are SCACT SCBALL

*-- subroutine to print Balances from file SCPF
Read SCPF
Eval HoldACT = SCACT
Eval HoldSCAPP = SCAPP
DOW  %not(%eof(SCPF))
*-- now here&#039;s where we see if it&#039;s time to bail
If   HoldACT &lt;&gt; SCACT
EXSR PrintLN
Endif
*-- now process current record
Eval  TotalBall = TotalBall + SCBALL
Eval  HoldSCAPP = SCAPP
Read  SCPF
Enddo
Endsr

*....
Begsr  PrintLn
If TotalBal &gt; 0
Write TotalLn     &lt;-- print fields holdACT, HoldSCAPP, TotalBal
Endif
* --- prepare next group
Eval HoldACT = SCACT
Eval HoldSCAPP = SCAPP
Eval TotalBall = *ZERO
Endsr]]></description>
		<content:encoded><![CDATA[<p>So, every time you see a new SCACT you&#8217;ll have<br />
a total to print (provided it&#8217;s not zero)</p>
<p>Very easy, should have been part of your logic class.</p>
<p>Except I don&#8217;t know where you&#8217;re getting the EUR from<br />
 or why you want to print the 003 or 002 from the last record.</p>
<p>There seems to be a little problem with the columns,<br />
I assume that 003 comes from SCAPP the<br />
others that I want are SCACT SCBALL</p>
<p>*&#8211; subroutine to print Balances from file SCPF<br />
Read SCPF<br />
Eval HoldACT = SCACT<br />
Eval HoldSCAPP = SCAPP<br />
DOW  %not(%eof(SCPF))<br />
*&#8211; now here&#8217;s where we see if it&#8217;s time to bail<br />
If   HoldACT &lt;&gt; SCACT<br />
EXSR PrintLN<br />
Endif<br />
*&#8211; now process current record<br />
Eval  TotalBall = TotalBall + SCBALL<br />
Eval  HoldSCAPP = SCAPP<br />
Read  SCPF<br />
Enddo<br />
Endsr</p>
<p>*&#8230;.<br />
Begsr  PrintLn<br />
If TotalBal &gt; 0<br />
Write TotalLn     &lt;&#8211; print fields holdACT, HoldSCAPP, TotalBal<br />
Endif<br />
* &#8212; prepare next group<br />
Eval HoldACT = SCACT<br />
Eval HoldSCAPP = SCAPP<br />
Eval TotalBall = *ZERO<br />
Endsr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AymanAbbas</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109372</link>
		<dc:creator>AymanAbbas</dc:creator>
		<pubDate>Thu, 19 Jul 2012 13:16:47 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109372</guid>
		<description><![CDATA[what&#160;actually happen
      BALANCE        		    CCY  TYPE 
=================================================
      1888.95                      EUR  CA  003
           
   1248805.34                      EGP  CF  002
           
    515663.91                      EGP  HB  461
           
          .00                      EGP  JB  301
           
   1038030.00-                     EGP  JB  302
         
   2065162.00-                     EGP  JB  303
         
   3798751.00-                     EGP  JB  304
         
   4904056.20-                     EGP  JB  305
         
   5611598.20-                     EGP  JB  306
         
   6785762.20-                     EGP  JB  307             // with the last total
         
  32415016.27-                     EGP  JT  308
         
  49289996.45-                     EGP  JT  309            // with the last total
         
   8784102.96-                     EGP  R1  600
         
       100.00-                     EGP  S5  310
        
   1248879.00                      EGP  WN  701]]></description>
		<content:encoded><![CDATA[<p>what&nbsp;actually happen<br />
      BALANCE        		    CCY  TYPE<br />
=================================================<br />
      1888.95                      EUR  CA  003</p>
<p>   1248805.34                      EGP  CF  002</p>
<p>    515663.91                      EGP  HB  461</p>
<p>          .00                      EGP  JB  301</p>
<p>   1038030.00-                     EGP  JB  302</p>
<p>   2065162.00-                     EGP  JB  303</p>
<p>   3798751.00-                     EGP  JB  304</p>
<p>   4904056.20-                     EGP  JB  305</p>
<p>   5611598.20-                     EGP  JB  306</p>
<p>   6785762.20-                     EGP  JB  307             // with the last total</p>
<p>  32415016.27-                     EGP  JT  308</p>
<p>  49289996.45-                     EGP  JT  309            // with the last total</p>
<p>   8784102.96-                     EGP  R1  600</p>
<p>       100.00-                     EGP  S5  310</p>
<p>   1248879.00                      EGP  WN  701</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AymanAbbas</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109371</link>
		<dc:creator>AymanAbbas</dc:creator>
		<pubDate>Thu, 19 Jul 2012 13:12:10 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109371</guid>
		<description><![CDATA[what&#160;actually happen
      BALANCE       &#124; 		    CCY  &#124;TYPE 
=================================================
      1888.95         &#124;             EUR  CA  003
           
   1248805.34       &#124;               EGP  CF  002
           
    515663.91        &#124;              EGP  HB  461
           
          .00              &#124;        EGP  JB  301
           
   1038030.00-       &#124;              EGP  JB  302              /* 
         
   2065162.00-        &#124;             EGP  JB  303
         
   3798751.00-         &#124;            EGP  JB  304
         
   4904056.20-        &#124;             EGP  JB  305
         
   5611598.20-        &#124;             EGP  JB  306
         
   6785762.20-        &#124;             EGP  JB  307
         
  32415016.27-        &#124;             EGP  JT  308
         
  49289996.45-        &#124;             EGP  JT  309
         
   8784102.96-       &#124;              EGP  R1  600
         
       100.00-          &#124;           EGP  S5  310
        
   1248879.00          &#124;            EGP  WN  701       BALANCE       &#124; 		    CCY  &#124;TYPE 
=================================================
      1888.95         &#124;             EUR  CA  003
           
   1248805.34       &#124;               EGP  CF  002
           
    515663.91        &#124;              EGP  HB  461
           
          .00              &#124;        EGP  JB  301               
           
   1038030.00-       &#124;              EGP  JB  302            
         
   2065162.00-        &#124;             EGP  JB  303              
         
   3798751.00-         &#124;            EGP  JB  304
         
   4904056.20-        &#124;             EGP  JB  305
         
   5611598.20-        &#124;             EGP  JB  306
         
   6785762.20-        &#124;             EGP  JB  307         // the last total amount which need to print
         
  32415016.27-        &#124;             EGP  JT  308
         
  49289996.45-        &#124;             EGP  JT  309         // the last total amount which need to print
         
   8784102.96-       &#124;              EGP  R1  600
         
       100.00-          &#124;           EGP  S5  310
        
   1248879.00          &#124;            EGP  WN  701
Hope you get the point and not be confused anymore&#160;
]]></description>
		<content:encoded><![CDATA[<p>what&nbsp;actually happen<br />
      BALANCE       | 		    CCY  |TYPE<br />
=================================================<br />
      1888.95         |             EUR  CA  003</p>
<p>   1248805.34       |               EGP  CF  002</p>
<p>    515663.91        |              EGP  HB  461</p>
<p>          .00              |        EGP  JB  301</p>
<p>   1038030.00-       |              EGP  JB  302              /* </p>
<p>   2065162.00-        |             EGP  JB  303</p>
<p>   3798751.00-         |            EGP  JB  304</p>
<p>   4904056.20-        |             EGP  JB  305</p>
<p>   5611598.20-        |             EGP  JB  306</p>
<p>   6785762.20-        |             EGP  JB  307</p>
<p>  32415016.27-        |             EGP  JT  308</p>
<p>  49289996.45-        |             EGP  JT  309</p>
<p>   8784102.96-       |              EGP  R1  600</p>
<p>       100.00-          |           EGP  S5  310</p>
<p>   1248879.00          |            EGP  WN  701       BALANCE       | 		    CCY  |TYPE<br />
=================================================<br />
      1888.95         |             EUR  CA  003</p>
<p>   1248805.34       |               EGP  CF  002</p>
<p>    515663.91        |              EGP  HB  461</p>
<p>          .00              |        EGP  JB  301               </p>
<p>   1038030.00-       |              EGP  JB  302            </p>
<p>   2065162.00-        |             EGP  JB  303              </p>
<p>   3798751.00-         |            EGP  JB  304</p>
<p>   4904056.20-        |             EGP  JB  305</p>
<p>   5611598.20-        |             EGP  JB  306</p>
<p>   6785762.20-        |             EGP  JB  307         // the last total amount which need to print</p>
<p>  32415016.27-        |             EGP  JT  308</p>
<p>  49289996.45-        |             EGP  JT  309         // the last total amount which need to print</p>
<p>   8784102.96-       |              EGP  R1  600</p>
<p>       100.00-          |           EGP  S5  310</p>
<p>   1248879.00          |            EGP  WN  701<br />
Hope you get the point and not be confused anymore&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AymanAbbas</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109370</link>
		<dc:creator>AymanAbbas</dc:creator>
		<pubDate>Thu, 19 Jul 2012 13:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-a-total-of-amount-field-in-rpgle-code/#comment-109370</guid>
		<description><![CDATA[what i need to do is printing a report with this data&#160;
      BALANCE    &#124;    		    CCY &#124; TYPE 
=================================================
      1888.95            &#124;          EUR  &#124;CA &#124; 003&#124;
           
   1248805.34         &#124;             EGP  CF  002
           
    515663.91          &#124;            EGP  HB  461
         
   6785762.20-        &#124;              EGP  JB  307
       
  49289996.45-       &#124;             EGP  JT  309
         
   8784102.96-        &#124;           EGP  R1  600
         
       100.00-            &#124;      EGP  S5  310
        
   1248879.00         &#124;         EGP  WN  701]]></description>
		<content:encoded><![CDATA[<p>what i need to do is printing a report with this data&nbsp;<br />
      BALANCE    |    		    CCY | TYPE<br />
=================================================<br />
      1888.95            |          EUR  |CA | 003|</p>
<p>   1248805.34         |             EGP  CF  002</p>
<p>    515663.91          |            EGP  HB  461</p>
<p>   6785762.20-        |              EGP  JB  307</p>
<p>  49289996.45-       |             EGP  JT  309</p>
<p>   8784102.96-        |           EGP  R1  600</p>
<p>       100.00-            |      EGP  S5  310</p>
<p>   1248879.00         |         EGP  WN  701</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/8 queries in 0.012 seconds using memcached
Object Caching 395/396 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-23 18:51:10 -->