Author |
Message
|
KIT_INC |
Posted: Tue Oct 23, 2007 11:11 am Post subject: Bypass CAST exception |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
The very last thing I am asked to do in my message flow is to do a best effort casting of a portion of the message into character and output the result to a queue so that user can read it. It does not matter if the cast works or fails. But the standard broker exception handling (please correct me if I am wrong)is to roll back the message flow when the CAST statement fail. That portion of the message contains data supplied by our external client which we have no control on. It will cause the cast to fail if it contains data that can not be casted into the CCSID specified. I was wondering if there is way to bypass this exception and let the flow complete. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 23, 2007 11:31 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
dkeister |
Posted: Tue Oct 23, 2007 12:15 pm Post subject: |
|
|
Disciple
Joined: 25 Mar 2002 Posts: 184 Location: Purchase, New York
|
How about wiring the Failure terminal on the compute node doing the CAST, decoding the error and if a CAST failure, put the appropriate message to the output queue? _________________ Dean Keister |
|
Back to top |
|
 |
mgk |
Posted: Tue Oct 23, 2007 1:33 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
If you are using V6 look up the DEFAULT clause on the CAST statement. This should do what you want, ie avoid the exception if the CAST fails...
Cheer, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
KIT_INC |
Posted: Tue Oct 23, 2007 2:51 pm Post subject: |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
Thanks mgk. I am using V6. So I will looking into using the default.
Just for my education purpose, I have looked at declareing my own handler. it seems to be more appropriate for situation where there is SQLSTATE or return codes. I have difficulties finding what ESQL state or return code that I'll get when the cast statement fails. Is this documented anywhere ? Did I misunderstand the coding of the handler ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 23, 2007 4:52 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's not well documented... but from what I understand from other conversations with mgk... you could do something like use the VALUE clause of the declare handler to match a specific BIP number... or just set up a wildcard on the handler to catch *all* ESQL exceptions. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|