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



Agreed - I think you're much better off doing the conversion in RPG,w here it's handled easily. Perhaps have the data structure be filled manually with EVALs and have the pertinent fields defined as zoned.

It might be possible to use the CPYNV (Copy numeric value) MI API (it is part of QSYSINC - read-only kind of thing, so does not violate any concerns, IMO). Check it out in the MI Library Reference (part of C/C++ documentation)

But the problem of dispalying hex equivalent is interesting in its own right.

Vern

At 02:29 PM 2/3/2003 -0800, you wrote:
Random thought . . .

You write an RPG4 program to receive the packed/char and return the
numeric.  You could make it flexible by passing in the length to
substring out and unpack.  Once in the RPG, it is straight-forward.

>>> vhamberg@centerfieldtechnology.com 02/03/03 02:09PM >>>
This didn't work, Jim - data type mismatch.&CHAR has to be a string
representation of a number, not a hex value.

But something close can be done with %BIN. This becomes the same
problem as
displaying the hex-equivalent of a string, which has been solved
before.
Don't know if my solution is the same.

Negative numbers are not covered here - need to check for value of last

nybble of last byte. And number of decimals needs to be known ahead of
time.


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.