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



"M. Lazarus" wrote:
> 
> Barbara,
> 
>   I actually had decided on using %DecH().  The business application is
> data originally coming from an Excel spreadsheet.  I wanted to make a
> generic routine (*Module in a *SRVPGM) out of this conversion.   Since I
> don't know ahead of time what the length being passed might be, I was
> hoping that %Dec and %DecH might allow a runtime value to be used as the
> length (2nd parm in the BIF), but unfortunately, that value must be
> available at compile time.
> 
>   I'm at v5r2.  Has this changed in v5r3.  If not, are there any plans to
> allow it?
> 

There are no current plans to allow a variable for the %DEC/%DECH length
and decimal places.  It would be extremely complex to generate code to
do arithmetic operations using numeric values whose length is not known
at compile time.  
As Scott said, you can just use the maximum length for the digits and
pick some value for the decimals that gives you enough decimal precision
while maximizing your integer places.

In V5R3, the maximum for digits is 63, so you could handle the full V5R2
(len,dec) range of (31,0) to (31,31) by using 63,31 as the length and
decimals.  If you need more than 31 digits of integer places, you would
have to "sacrifice" some of the decimal precision ...


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.