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 IndexWebSphere Message Broker (ACE) SupportMOVE statement

Post new topicReply to topic
MOVE statement View previous topic :: View next topic
Author Message
RITCHEA
PostPosted: Thu Oct 13, 2011 1:34 am Post subject: MOVE statement Reply with quote

Apprentice

Joined: 25 Jul 2011
Posts: 27

if my tree structure is like
data.customer.fname
data.customer.lname
data.customer.age

I want to move from fname to lname and then age using move statement in ESQL.... Is that possible.
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Thu Oct 13, 2011 2:03 am Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

Read this
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ak05090_.htm
and do some experiments with your self.

NEXTSIBLING is your clue.

--
Marko
Back to top
View user's profile Send private message Visit poster's website
RITCHEA
PostPosted: Thu Oct 13, 2011 2:09 am Post subject: Reply with quote

Apprentice

Joined: 25 Jul 2011
Posts: 27

I tried MOVE nextsibling but it didnt work...
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Thu Oct 13, 2011 2:15 am Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

Can you provide your code and symptoms?

--
marko
Back to top
View user's profile Send private message Visit poster's website
RITCHEA
PostPosted: Thu Oct 13, 2011 2:42 am Post subject: Reply with quote

Apprentice

Joined: 25 Jul 2011
Posts: 27

Set Environment.variables = THE(select p.Start from Database.email_req AS p);
Set Environment.variables = THE(select t.ended from Database.email_req AS t);
-- ---- work ---------
DECLARE i INTEGER;
SET i=1;

while (i<=7) do
set Environment.variables.fields[i]= '' ;
set i=i+1;
END WHILE;

declare fields reference to InputRoot.MRM.data.fname;
-- WHILE LASTMOVE (fields) Do

WHILE (Environment.variables.Start <= Environment.variables.ended) DO

SET Environment.variables.fields[Environment.variables.Start] = fields;
SET Environment.variables.Start = Environment.variables.Start+1;
-- MOVE NEXTCHILD TO fields;
-- MOVE fields nextsibling;
-- MOVE fields PARENT;
-- MOVE NEXTSIBLING to fields;
-- MOVE fields to NEXTCHILD ;
END WHILE;

END WHILE;
This is code i am going in problem with
Back to top
View user's profile Send private message
MrSmith
PostPosted: Thu Oct 13, 2011 2:54 am Post subject: Reply with quote

Master

Joined: 20 Mar 2008
Posts: 215

to move from the fname to lname

Decalre yourself a reference that points to the structure data.customer

then

MOVE myref FIRSTCHILD TYPE 0x01000000 Name 'lname';

consequently

MOVE myref FIRSTCHILD TYPE 0x01000000 Name 'age';


You dont have to use the TYPE 0x01000000 but it clarifies that the search is for an Element not an attribute
Using LASTMOVE to check the move worked out OK.


you can then add repeats etc whatever as per the MOVE statement help
_________________
-------- *
“Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.”


Last edited by MrSmith on Thu Oct 13, 2011 2:57 am; edited 1 time in total
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Thu Oct 13, 2011 2:56 am Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

Can you describe what you want to do as step by step algorithm?

--
Marko
Back to top
View user's profile Send private message Visit poster's website
RITCHEA
PostPosted: Thu Oct 13, 2011 3:01 am Post subject: Reply with quote

Apprentice

Joined: 25 Jul 2011
Posts: 27

I am trying to Move to next child element in loop ....


Get the start and end field index from the database.

Initialize an array variable Fields[10] with default values of each
field.
Declare Fields character;
Declare i interger;
Set i=0
While i<10
Begin
Set Fields[i]=null;
i=i+1;
End;

From database :
startIndex=4;
endIndex=8;

Set the values of array with the incoming message field values starting
from
get reference of first element of the incoming message.
Declare custRef reference to InputRoot.MRM.data[1];

While(startIndex <=endIndex)
Begin
Fields[startIndex]=customerRef;
startIndex=startIndex+1;
move custRef;
End;
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Thu Oct 13, 2011 3:19 am Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

You should reread what is difference of NEXTSIBLING and FIRSTCHILD.
If i'm right followinf pseudo code should be helpful
Code:


InputRoot.
 MRM.
  data. <-- rReference points here after step 1)
   customer. <-- rReference points here after step 2)
     fname <-- rReference points here after step 3)
     lname <-- rReference points here after step 4)
     age

1) DECLARE rReference TO InputRoot.MRM.data;
2) MOVE rReference FIRSTCHILD;
3) MOVE rReference FIRSTCHILD;
4) MOVE rReference NEXTSIBLING;



Marko
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Thu Oct 13, 2011 3:32 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

To clarify:
The MOVE statement does not assign any data. You have to use the SET statement for that.

The MOVE statement changes the pointer of a reference. Always check if LASTMOVE(ref) to make sure that the given change in pointer was successful.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportMOVE statement
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.