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



It's unclear from your description how the data is stored in the character field. The values you specify on %DEC() are not for reading it's input, they are for controlling the *output* of the %DEC() BIF. Since you said you're moving to a fixed-length numeric field, you should be just fine with literals/constants for %DEC().

If the data in the char field isn't actually text data, but is already in numeric format (such as raw packed, zoned data or integer data) then you can use the LBCPYNV MI built-in to do the conversion. (%DEC wouldn't be useful in that case, since it expects the input to be text.)


On 3/2/2011 12:48 PM, Jeff Young wrote:
I have a character field where the number of digits and decimal places is stored
in a file.
I need to convert this to a fixed length numeric field that is defined in my
program.
It appears that the %Dec BIF required a literal or a value that is known at
compile time.
What is the best way to do this?

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.