title: How to sum up Datastructure subfields in RPGLE
body: <p>Today I read the <code>Who knew you could do that</code> manual. I came across the %XFoot BIF that calculates the sum of an (numeric) array. So I thought there must be a way to sum up the subfields of a datastructure array that holds (e.g.) invoices and their value.</p>
  
  <p>To get the invoice Data I run embedded SQL that stores the data from the database in a qualified datastructure which is defined as dim(1000). </p>
  
  <p>I tried to <code>%XFoot(invoiceDS:1:1000)</code> and <code>%XFoot(invoiceDS(*).value:1:1000)</code>. None of them compiled since the qualified expression is not allowd as parameter for %XFoot. </p>
  
  <p>Then I tried to get a sub-Portion if the datastructure array with <code>%SubArr(invoiceDS(*).value:1:1000)</code>. But this also failed since 'value' is no fieldgroup.</p>
  
  <p>Is there any solution for this?</p>