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



Hi Gary

You don't convert the number to hex - you convert the hex value of either msgnbr or msgnbrchar to its hex nybbles - so the result is a 4-character string - the first parameter of cvtch, right?

Can you show us your call to cvtch?

The 3rd parameter is the length of the 2nd parameter - so that should have a value of 2. It should be a 10i 0. First parameter is a 4-character variable, 2nd parameter can be the 5i 0 integer or its 2-character overlaid variable.

I know I'm stating the obvious. But sometimes a piercing glance at the obvious is what's needed.

Here's a prototype I have for cvtch - actually converts bytes to nybbles, once might say - these always get me a little turned around!

d convertCharacterToHex...
d pr extproc('cvtch')
d toString 512
d fromString 256
d fromStringLength...
d 10i 0 value

HTH
Vern

On 9/21/2012 2:54 PM, Monnier, Gary wrote:
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 ...

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.