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 » last move

Post new topic  Reply to topic
 last move « View previous topic :: View next topic » 
Author Message
gsreddy121
PostPosted: Thu Aug 14, 2014 11:24 pm    Post subject: last move Reply with quote

Newbie

Joined: 14 Aug 2014
Posts: 3

SET OutputRoot=InputRoot;
DECLARE K INTEGER 0;
DECLARE myref REFERENCE TO OutputRoot.XMLNSC.Data.Order.Item[1];
WHILE LASTMOVE(myref) = TRUE DO
SET OutputRoot.XMLNSC.Data.Order.Item[K]= K;

SET K = K + 1;
SET myref = myref + 1;

MOVE myref NEXTSIBLING;
END WHILE;


INPUT:
<Data><Order><Item></Item><Item></Item><Item></Item></Data>
i am not getting output,please give me solution for this.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Aug 15, 2014 12:38 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Would you please like to explain what you are trying to do?

There is one issue in the K has an initial value of 0 indexes with a value of 0 are not allowed in ESQL

But please explain what you are trying to do.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Aug 15, 2014 4:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

smdavies99 wrote:
Would you please like to explain what you are trying to do?




Logically, that code doesn't make sense. What's the expected output? You're almost certainly getting no output because at some point in that twisted loop you get a null, and hence delete the output tree.

A user trace would have shown you this.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Aug 15, 2014 4:51 am    Post subject: Reply with quote

Grand High Poobah

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

Have you tried changing your code to the following?

Code:
SET OutputRoot=InputRoot;
DECLARE K INTEGER 0;
DECLARE myref REFERENCE TO OutputRoot.XMLNSC.Data.Order.Item[1];
WHILE LASTMOVE(myref)  DO
   SET K = K + 1;
   SET myref = K;

   MOVE myref NEXTSIBLING;
END WHILE;


Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Aug 15, 2014 4:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
Have you tried changing your code to the following?

Code:
SET OutputRoot=InputRoot;
DECLARE K INTEGER 0;
DECLARE myref REFERENCE TO OutputRoot.XMLNSC.Data.Order.Item[1];
WHILE LASTMOVE(myref) = TRUE DO
   SET K = K + 1;
   SET myref = K;

   MOVE myref NEXTSIBLING;
END WHILE;


Have fun


Well.

I mean.

That's still trying to treat an Integer as a REFERENCE value.

But, really, if the whole point is to count the occurances, then one should simply use CARDINALITY.

If the whole point is to loop over each DATA.Order.Item, then one should absolutely positively JUST USE A FOR LOOP AND NOT HAVE TO WORRY ABOUT MOVING REFERENCES.

I mean, how is this hard? http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak05030_.htm?lang=en

And it's not like there aren't plain examples in the docs of how to use a WHILE ... LASTMOVE.. loop either.

http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak05090_.htm?lang=en

Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Aug 15, 2014 5:42 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

@gsreddy121 - what exactly are you trying to achieve here? All you seem to have managed is to confuse everyone.

How did you arrive at the code you posted? What did you reference to write it? What diagnostic steps have you taken and what results did you obtain? Can you post these?

Better information, better advice and certainly less confusion.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » last move
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.