Author |
Message
|
wbintegrator |
Posted: Wed Mar 29, 2006 6:21 am Post subject: Cast blob to char: ebcdic to ascii |
|
|
Voyager
Joined: 08 Feb 2006 Posts: 83
|
I have a problem trying to cast an ebcidic message from IMS to ascii.
I've tried a row of CCSID-s 819,916,1208 etc but nothing worked.
Code: |
DECLARE imsMsg CHAR CAST(InputBody.BLOB AS CHAR CCSID 916); |
In case u wonder why I need the IMS message: whenever a mainframe procedure terminates abnormally or if theIMS is shutting down, it keeps sending messages notifying of that and the users have no way to know it as the exception handling I have doesn't "know" to identify this cases. So I'm trying to identify these cases by parsing the IMS messages.
Thanks in advance. |
|
Back to top |
|
 |
fschofer |
Posted: Wed Mar 29, 2006 6:34 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
|
Back to top |
|
 |
wbintegrator |
Posted: Wed Mar 29, 2006 6:43 am Post subject: |
|
|
Voyager
Joined: 08 Feb 2006 Posts: 83
|
37 did the job,
Thanks a lot frank. |
|
Back to top |
|
 |
wbintegrator |
Posted: Tue Apr 04, 2006 9:40 pm Post subject: |
|
|
Voyager
Joined: 08 Feb 2006 Posts: 83
|
By the way, The reason I couldn't cast it using other CCSIDs turned out to be the '00' in the beginning of the BLOB. Apparently there is some C/C++ processing of the string during the cast, and the null terminateion-oriented processing failed at the very beginning of the string.
I replaced all the X'00' with X'40' and the cast worked. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 05, 2006 2:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I would have tried to use InputRoot.BLOB.BLOB in the cast command...
That might take care of your hex 00 problem?
Another way to try it (if it is not a reply node) is to set the convert flag on the input node.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 05, 2006 4:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fjb_saper wrote: |
I would have tried to use InputRoot.BLOB.BLOB in the cast command...
That might take care of your hex 00 problem? |
InputBody is a synonym for InputRoot.BLOB... so InputRoot.BLOB.BLOB is the same as InputBody.BLOB. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|