Gary,
I thought so at first as well. Only 2 bytes are returned for msgnbr.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Thompson
Sent: Friday, September 21, 2012 1:05 PM
To: RPG programming on the IBM i / System i
Subject: RE: Converting an into to hex to char
Gary,
Wild guess on my part, but for some
reason I >think< msgnbr could actually be character/text ???
-----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
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.