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



When you tried to convert msgnbrchar from hex to character, did you define the character result field as a length of 4? Can you provide the pertinent code? The error message C2M3001 (A domain error in a math function occurred.) doesn't make sense if the from and two fields were properly defined.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Monnier, Gary
Sent: Friday, September 21, 2012 1:54 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Converting an into to hex to char

All,

I've gone a bit brain dead today it seems and I'm hoping someone can help me reignite the ol' synapses.

I have a program using the Convert Integers to Seconds (CEEISEC) API. This API uses the CEE feedback structure to return error information.

D feedback DS
D severity 5I 0
D msgnbr 5I 0
D msgnbrchar 2A overlay(msgnbr:1)
D bits 1
D facility 3
D i_s_info 10I 0

When I force invalid data in debug I have a msgnbr and a facility of CEE returned. This is as expected. Trouble is msgnbr does not relate to any CEExxxx message unless I display msgnbr in hex.

For example when in debug if I supply an invalid hour and press (F11) on variable msgnbr I see 9488 for a value. There is no error message CEE9488 that I can find.

But if I display msgnbr in hex (eval msgnbr:x) I see 2510. Error message CEE2510 (The value for hour is not valid.) does exist and is in fact the error I forced.

Using msgnbr or msgnbrchar with cvtch() throws C2M3001 so I know I have to convert msgnbr to a hex value.

My quandary is how in the world do I convert integer 9488 to hex value x'2510' so I can use cvtch() to convert x'2510' to character value '2510'?

I want to build the CEExxxx message number by concatenating facility and the converted msgnbr.

Thanks,

Gary Monnier
--


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.