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 » Inserting values into field array based on index.

Post new topic  Reply to topic
 Inserting values into field array based on index. « View previous topic :: View next topic » 
Author Message
Blomman
PostPosted: Tue Jul 27, 2010 6:25 am    Post subject: Inserting values into field array based on index. Reply with quote

Master

Joined: 31 Oct 2006
Posts: 230

Hi!

I have an simple issue that im sure there are many ways to solve it...

Whit in an LOOP:
I want to put an value of variable "MetadataListEntry" into index "i" in "InputLocalEnvironment.Variables.MetaList.List[]"

What i want to do:

Code:

SET InputLocalEnvironment.Variables.MetaList.List[] = LIST{'test1','test2','test3'};


But i want to do it based on index in LOOP,some thing like this.
OBS!
Variable MetaDataListaEntry gets an new value each turn in loop but i havent included that logic here.
Code:


DECLARE i INTEGER 1;
 
 Z : LOOP
    IF i > 10  THEN
      LEAVE Z;
    ELSE
      SET InputLocalEnvironment.Variables.MetaList[i].List[] = LIST{MetadataListEntry};
    END IF;
    SET i = i + 1;
END LOOP Z;


Best Regards!

//Micke
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 27, 2010 7:39 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.

firstly, you can't update the InputLocalEnvironment only the OutputLocalEnvironment

Secondly, why don't you use a FOR loop? you are looping 10 times
_________________
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
fjb_saper
PostPosted: Tue Jul 27, 2010 7:41 am    Post subject: Reply with quote

Grand High Poobah

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

Bad move.
If you want to use indexes be aware of the cost.
Usually with loops like this you should be using a reference.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Tue Jul 27, 2010 9:07 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
firstly, you can't update the InputLocalEnvironment only the OutputLocalEnvironment


Actually you can .


regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 27, 2010 11:09 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.

mgk wrote:
Quote:
firstly, you can't update the InputLocalEnvironment only the OutputLocalEnvironment


Actually you can .


regards,


Perhaps I should have said 'You Shouldn't ...'.

In all honesty, I have yet to come upon a compelling reason to even want to do this. After all you are making changes to something that will dissapear when you exit the node. If you wanted to keep it, why not copy it first or copy & modify in one go.
But hey, that is my preference. I prefer the separation of Input & Outputs but that is probably due to my Control Systems Eng Background more than anything

_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Inserting values into field array based on index.
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.