|
On 4/19/06, DeLong, Eric <EDeLong@xxxxxxxxxxxxxxx> wrote: > > For performance purposes, you might want to avoid using a return value by > passing the ReasonDS as a bi-directional parm. Return values are > notorious > for being slow when returning large amounts of data. > > Doing this means you can't call this function as part of an expression, > but > I would not expect that you're needing to use the ReasonDS directly in a > calculation, since it's not returning a simple value.... > > Your prototype would look something like this: > D BilUtil_getReasonTotals... > D PR > D @prPlant_ 3 0 Value > D @prBillTo_ 5 0 Value > D @prBillDate_ D Value > D @prInvoice_ 5 0 Value > D tempReasonDS LikeDS(ReasonDS) > > Add your ReasonDS into the copy member along with your prototype, so that > you always compile from a common DS definition. > > Also, take a look at your %lookup. Since you're uning counters to track > how > many elements you have loaded, you can save some cycles on the lookup by > specifying parms 3 and 4 (starting element, number of elements to search) > in > the %lookup bif... > > FWIW, when I use an array DS as parameter data, I often include associated > data fields in the DS definition. For example, I add @Count to the DS, so > that I always have a valid value for the number of elements loaded to the > arrays..... > > Another suggestion, if ever you need to sort the ReasonDS, you will need > to > define your array so that all element sort properly. See the example > below... > > * Array of Data structures to hold reason code details > D ReasonDS DS 5400 > D @Count 2 0 > D @RsnArray Dim(200) > D @RsnCode 2A Overlay(@RsnArray:1) > D @Charge 9 2 Overlay(@RsnArray:*Next) > D @Weight 9 0 Overlay(@RsnArray:*Next) > D @Units 7 0 Overlay(@RsnArray:*Next) > > >>> IF I declare this way: 1. can I do a %lookup('XX': @RsnCode) ? I want to use @RsnCode as a key. 2. can I do this: ReasonDS.@Charge(2) = 20 ? >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.