|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
using declare reference to |
« View previous topic :: View next topic » |
Author |
Message
|
kirani |
Posted: Thu Jul 18, 2002 8:18 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
kwelch wrote: |
I was under the impression, from a prior thread, on the same subject, that if you declared something within an IF or a WHILE that you could only use it within those confines?
|
Well ... that's true, but in above code we are declaring REFERENCE variable outside the loop, so it can be referred anywhere within the compute node.
Let me know how it goes on Monday. Have a great weekend! _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
kwelch |
Posted: Tue Jul 23, 2002 7:50 am Post subject: |
|
|
 Master
Joined: 16 May 2001 Posts: 255
|
Hi Kiran,
I wasn't sure if the same applied to CREATE FIELD. I tried your solution and got it to work on a small example. I will have to try and incorporate it into our much larger project where there are numerous tags and levels. I don't see why it should not work though! Thanks again for all your help.
Karen |
|
Back to top |
|
 |
Miriam Kaestner |
Posted: Thu Jul 25, 2002 1:25 am Post subject: |
|
|
Centurion
Joined: 26 Jun 2001 Posts: 103 Location: IBM IT Education Services, Germany
|
There is another way to change the field names (XML tags), which may be also helpful in this case (many subfields):
-- at the end of your code
IF (InputRoot.XML.Customer.Code <> 'S') THEN
SET OutputRoot.XML.Customer.Address NAME = 'SWAddress';
END IF; |
|
Back to top |
|
 |
kwelch |
Posted: Thu Jul 25, 2002 10:01 am Post subject: |
|
|
 Master
Joined: 16 May 2001 Posts: 255
|
|
Back to top |
|
 |
CHERIANV |
Posted: Mon Aug 05, 2002 4:47 pm Post subject: |
|
|
Apprentice
Joined: 15 Feb 2002 Posts: 43 Location: New York
|
Hi,
I am facing a somewhat similar problem when using CREATE FIELD along with PROPAGATE.
Suppose I use it like the following for an XML to MRM transformation for assigning my OutputRoot.MRM fields,it ofcourse doesnt work as it expects the CREATE FIELD and outref declaration to be within WHILE loop. I just want to figure out the most efficient way to do this as I have several lines of similiar field assignments and several messages and different scenarios to PROPAGATE within the WHILE loop.
DECLARE inref REFERENCE to InputRoot.XML.PARENT.CHILD[1];
CREATE FIELD OutputRoot.MRM.LEVEL1.LEVEL2;
DECLARE outref REFERENCE to OutputRoot.MRM.LEVEL1.LEVEL2;
WHILE LASTMOVE(inref) THEN
Assign Properties;
Assign MQMD;
Set outref.field1 = 'a';
Set outref.field2 = 'b';
Set outref.field3 = 'c';
PROPAGATE;
MOVE inref TO NEXTSIBLING REPEAT NAME;
END DO;
RETURN FALSE; |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|