ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Error Codes

Post new topic  Reply to topic
 Error Codes « View previous topic :: View next topic » 
Author Message
Lisa
PostPosted: Fri Feb 20, 2004 10:02 am    Post subject: Error Codes Reply with quote

Master

Joined: 07 Jun 2002
Posts: 287
Location: NJ

All,
I need to search a string and if I find 1 of 50 error codes,
I need to move the error code to Err-Code field and
the error text message to Err-Text field.

Here's the problem. I need to code all 50 error text message in WMQI, because the string contains error code only.

How would you do this? I realy don't want to create 50 IF statements!

Lisa
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Fri Feb 20, 2004 10:33 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Sounds like you need a table that relates an Error code to an Error string, that you could then select from.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Lisa
PostPosted: Fri Feb 20, 2004 12:28 pm    Post subject: Error Codes Reply with quote

Master

Joined: 07 Jun 2002
Posts: 287
Location: NJ

THanks Jeff, But I do not want to use a DB.

Any other suggestions?

Lisa
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Fri Feb 20, 2004 12:36 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can run an ESQL select against a message tree, as well as a database table.

So build your "table" in Environment.Variables.MyErrorTable, or some such, and select from that.

Something like
Code:
Set Environment.Variables.MyErrorTable = row(row(1 as ErrNum,'Error Number One has Occurred' as ErrStr),row(2 as ErrNum,'Error Number Two has Occurred' as ErrStr));
set OutputRoot.XML.Document.Err-Text = (Select the(x.ErrStr) from Environment.Variables.MyErrorTable as x where x.ErrNum = InputRoot.XML.Err-Code);
Set OutputRoot.XML.Document.Err-Code = InputRoot.XML.Err-Code;

This is untested, off the top of my head code. So it probably doesn't work the way it's written. But the idea is valid.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Lisa
PostPosted: Fri Feb 20, 2004 12:43 pm    Post subject: Error Codes Reply with quote

Master

Joined: 07 Jun 2002
Posts: 287
Location: NJ

Once again, thanks Jeff.

You have provided me with an interesting option!


Lisa
Back to top
View user's profile Send private message Send e-mail
Michael Dag
PostPosted: Sat Feb 21, 2004 5:03 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

Will you provide us a "working" sample

Michael
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Sat Feb 21, 2004 7:29 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

MichaelDag wrote:
Will you provide us a "working" sample


Me?

Or Lisa?

I'll do so if I get a chance.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Sat Feb 21, 2004 9:00 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

No not you... I meant Lisa!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lisa
PostPosted: Sat Feb 21, 2004 6:20 pm    Post subject: Error Codes Reply with quote

Master

Joined: 07 Jun 2002
Posts: 287
Location: NJ

Yes, Once I decide on how I want to handle error message codes.

Lisa
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Feb 25, 2004 12:48 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Here's a working piece of code.
Code:
Set Environment.Variables.MyErrorTable = ROW(
     ROW(1 AS ErrNum,'Error Number One has Occurred' AS ErrStr),
     ROW(2 as ErrNum,'Error Number Two has Occurred' as ErrStr));
set Environment.Variables.ErrText = (
    Select ITEM X.ErrStr
    from Environment.Variables.MyErrorTable.* as X
    where X.ErrNum = 1);

Which gives me the following in a trace
Code:
(0x01000000):Variables = (
    (0x01000000):MyErrorTable = (
      (0x01000000):Column0 = (
        (0x03000000):ErrNum = 1
        (0x03000000):ErrStr = 'Error Number One has Occurred'
      )
      (0x01000000):Column1 = (
        (0x03000000):ErrNum = 2
        (0x03000000):ErrStr = 'Error Number Two has Occurred'
      )
    )
    (0x03000000):ErrText      = 'Error Number One has Occurred'

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Error Codes
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.