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 » Referring to a variable in Field reference

Post new topic  Reply to topic
 Referring to a variable in Field reference « View previous topic :: View next topic » 
Author Message
catwood2
PostPosted: Thu Apr 08, 2004 8:51 am    Post subject: Referring to a variable in Field reference Reply with quote

Centurion

Joined: 17 May 2002
Posts: 108

I'm missing something obvious here.

I am doing a lookup in a database that returns various fields to drive transformation. One of the values is the XML_TAG to transform. I assign this value to a variable. Then, I attempt to reference variable (FldToxXFM) like this:

Code:
   IF InputRoot.XML.TEST.FldToXFM = Environment.Variables.Result.SOURCE_VALUE THEN
     SET OutputRoot.XML.TEST.FldToXFM = Environment.Variables.Result.TARGET_VALUE;


It will not pick up the intended value. I know it's assigned properly - b/c if I put parenthesis around 'FldToXFM' it throws an exception with the expected
Code:
BIP2546E: (35, 25) : (...) field type expression does not evaluate to INTEGER value; ''STATUS'' evaluates to CHARACTER.


Status is my tag name and what FldToXFM is holding. If I hard code the 'STATUS' - it works as expected.

ANy thoughts greatly appreciated.
Back to top
View user's profile Send private message
JT
PostPosted: Thu Apr 08, 2004 9:11 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Can you post your ESQL code, specifically the code that sets Environment.Variables.Result.TARGET_VALUE? Have you tried setting a user trace on your message flow to confirm that Environment.Variables.Result.TARGET_VALUE is not actually set to NULL?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 08, 2004 10:08 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you want to use the { } instead of the ( ).

If I understand what you're trying to do.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Apr 08, 2004 10:08 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

You need to put {...} around the varaible to force WMQI to evaluate it. Otherwise it takes the name you have used, not the contents.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
catwood2
PostPosted: Thu Apr 08, 2004 10:09 am    Post subject: Reply with quote

Centurion

Joined: 17 May 2002
Posts: 108

JT-
I have done a Usertrace (results pasted below). Also, when it evaluates the variable with parenthesis around it - the error shows that it is indeed holding the value. And, if I hard code that value in place of the Variable - code works as expected...thx

Trace:
Code:
(0x1000000)Variables = (
    (0x1000000)Result = (
      (0x3000000)XML_TAG      = 'STATUS'
      (0x3000000)XFM_ACTION   = 'REPLACE'
      (0x3000000)SOURCE_VALUE = 'On Hold'
      (0x3000000)TARGET_VALUE = 'Frozen'
    )
  )
)
AND
(
  (0x1000000)TEST = (
    (0x1000000)Message_Type = (
      (0x2000000) = 'GETSTABF'
    )
    (0x1000000)Source_Appl  = (
      (0x2000000) = 'UTCREM45'
    )
    (0x1000000)STATUS       = (
      (0x2000000) = 'On Hold'
    )
    (0x1000000)MsgTyp       = (
      (0x2000000) = 'GETSTABF'
    )
  )
)


ESQL code for environment variable:
Code:
SET Environment.Variables.Result[]=
(SELECT Transformation.XML_TAG, Transformation.XFM_ACTION,Transformation.SOURCE_VALUE,Transformation.TARGET_VALUE from Database.Transformation WHERE Transformation.MESSAGE_TYPE = MTYPE AND Transformation.SOURCE_APPL = SRCAPP);
SET VarAccess = Environment.Variables.Result[1];
Back to top
View user's profile Send private message
catwood2
PostPosted: Thu Apr 08, 2004 10:12 am    Post subject: Reply with quote

Centurion

Joined: 17 May 2002
Posts: 108

Thanks! That's what I was missing. I need to go back and find that in the ESQL manual (which, I did search before posting..erg)
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 » Referring to a variable in Field reference
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.