× 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.



Thanks Mark, but %size() returns the number of bytes, which in a packed
numeric is roughly half the value that %LEN() returns (for a packed(13:2)
field %size returns 7).

And in the RPG reference %LEN and %DECPOS are both used in constants in
some fixed-format examples.(e.g. the examples for %LEN):
D NUM1_LEN C %len(num1)
D NUM1_DECPOS C %decpos(num1)


-Paul.


On Tue, 23 Apr 2019 at 16:27, mlazarus <mlazarus@xxxxxxxxxxxx> wrote:

Paul,

The %LEN() BIF does NOT return constant data. Use the %SIZE() BIF.

-mark

On 4/23/2019 8:42 AM, Paul Bailey wrote:
Hi,

I might be having a bad-brain-day, but I thought the following was
possible:
dcl-s TTAAMT_x like(CURR_1) inz; // currently packed(13: 2)
dcl-c C_TTAAMT_LEN CONST(%LEN(TTAAMT_x));
dcl-c C_TTAAMT_DP CONST(%DECPOS(TTAAMT_x));
// needed for multiple data structure overlays
dcl-s TTAAMT_z zoned(C_TTAAMT_LEN: C_TTAAMT_DP) inz;

I want to declare a zoned field with the exact same dimensions as a
packed
field, and the dimensions of that packed field are set in a file.

I am getting "RNF3320: The keyword parameter is not defined; keyword is
ignored." on both usages of the constant on the definition of the zoned
field when compiling the code.

I'm on v7r3 and the relevant help text for ZONED(digits {:
decimal-positions}) says "Each parameter can be a literal or a named
constant.".

What am I doing wrong? Is there a better way to have a zoned field with
the
same dimensions as a packed field without hard-coding the dimensions in
the
source?


-Paul.

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.