|
I tried using %decpos on a template variable, and it wouldn't let me:
editCode = $GetUsageAmountEditCode( %decPos( dsT_Inv_State.SBeg ) );
RNF0655: Item SBEG was defined with TEMPLATE and cannot be used in this context.
RNF0655: Item DST_INV_STATE was defined with TEMPLATE and cannot be used in this context.
dsT_Inv_State is indeed a template data structure, but I don't understand why this won't work. Unlike %len, which returns the length of a field which can fluctuate if it's a varchar, I don't see how %decpos could be anything but the decimal precision of the field at compile time. Am I missing something here? We're at IBM i 7.1.
In this particular case, I have two amount fields defined like the SBeg subfield mentioned above. I wanted to get the %decpos of the field that the amount fields are being defined like, instead of arbitrarily picking one (what if one goes away with a future change, then this procedure call will have to change as well).
And in case anyone's wondering what in the world I'd do with an edit code in a variable since %editC doesn't support a variable as the second parameter (sigh), I have another procedure that translates it into an %editC with the hardcoded edit code.
Thanks,
Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery Platform
[cid:image002.jpg@01CD16F9.25D27630]
web: www.customcall.com<http://www.customcall.com/> | email: kurt.anderson@xxxxxxxxxxxx<mailto:kurt.anderson@xxxxxxxxxxxx>
A Division of Enghouse Systems Ltd.<http://www.enghouse.com/> (TSX:ESL)
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.