|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
modifying the outputroot within a procedure? |
« View previous topic :: View next topic » |
Author |
Message
|
novice |
Posted: Thu Sep 29, 2005 5:50 am Post subject: modifying the outputroot within a procedure? |
|
|
Apprentice
Joined: 20 Jun 2005 Posts: 37
|
hi everybody!
within my esql project there is a sequence of statements that are used a lot of times. i want to place them in a procedure that i can use within all the flows.
the context is the following one:
i read records from a db and create per record a message.
then i've to modify a value of the properties tree and create a minimal mqmd header. for this purpose i use these statements, that work fine if there are not placed into a procedure.
SET OutputRoot.Properties.ReplyIdentifier = MQCI_NONE;
SET OutputRoot.MQMD.Version = MQMD_CURRENT_VERSION;
SET OutputRoot.MQMD.StrucID= MQMD_STRUC_ID;
...
...
these are exactely the statements that i want to put in a procedure.
i tried to do this in different ways and no one is working
alway a exception is thrown when the message arives to the mqoutput node.
here two examples:
DECLARE rOutputRoot REFERENCE TO OutputRoot;
CALL SetHeaders(rOutputRoot);
...
...
...
1)
CREATE PROCEDURE SetHeaders(INOUT rOutputRoot REFERENCE) BEGIN
SET rOutputRoot.Properties.ReplyIdentifier= MQCI_NONE;
SET rOutputRoot.MQMD.Version= MQMD_CURRENT_VERSION;
SET rOutputRoot.MQMD.StrucID= MQMD_STRUC_ID;
END;
or 2)
CREATE PROCEDURE SetHeaders(INOUT rOutputRoot REFERENCE) BEGIN
CREATE NEXTSIBLING OF rOutputRoot.Properties NAME 'MQMD'
SET rOutputRoot.Properties.ReplyIdentifier= MQCI_NONE;
SET rOutputRoot.MQMD.Version= MQMD_CURRENT_VERSION;
SET rOutputRoot.MQMD.StrucID= MQMD_STRUC_ID;
END;
by the way, i'm using wbimb 5, csd 5. any suggestions, ideas? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 29, 2005 5:56 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What is the exception that is thrown? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wschutz |
Posted: Thu Sep 29, 2005 6:02 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
|
Back to top |
|
 |
mgk |
Posted: Thu Sep 29, 2005 6:42 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
Although the post of mine mentioned above explains what IN, OUT and INOUT directions mean for references, it does not answer your question directly.
However, another post of mine here http://www.mqseries.net/phpBB2/viewtopic.php?t=10595&highlight=outputroot+reference does answer your problem, which is that a reference to OutputRoot is not the same as OutputRoot itself.
In your example 2 below, you need to use the DOMAIN clause on the CREATE to create an MQMD parser (an maybe a Properties parser as well (if you have deleted the auto-created one)). Or (if the procedure is created at module scope) just use OutputRoot itself (as it is really just an implicitly declared Module Level variable and so is always in scope at Module level in V5 (not 2.1 tho) ).
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 |
|
 |
novice |
Posted: Fri Sep 30, 2005 1:42 am Post subject: |
|
|
Apprentice
Joined: 20 Jun 2005 Posts: 37
|
thanx
it works if i create the mqmd the following way:
CREATE NEXTSIBLING OF rOutputRoot.Properties DOMAIN 'MQMD';
instead of
CREATE NEXTSIBLING OF rOutputRoot.Properties NAME 'MQMD'; |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|