× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Kurt

An idea - there is no memory allocated to a template. You have 2 messages saying that neither the structure nor its subfield can be used, since they are in a DS defined with TEMPLATE.

I have a feeling that %len would also fail when used against a templated item - does it?

It seems we SHOULD be able to get attributes of variables that were defined with TEMPLATE, doesn't it? Or am I expecting more than is practical? Is this possible with templates in C/C++?

Vern

On 6/6/2014 12:42 PM, Kurt Anderson wrote:
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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.