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 » Cannot set MQRFH2 header

Post new topic  Reply to topic
 Cannot set MQRFH2 header « View previous topic :: View next topic » 
Author Message
zico
PostPosted: Mon Jul 31, 2006 1:08 pm    Post subject: Cannot set MQRFH2 header Reply with quote

Novice

Joined: 22 Jun 2005
Posts: 21

Hi,

I have a .esql file for common functions and procedure. I created a procedure CopyRFH2Header to set MQRFH2 header and the procedure will be called inside some of the message flow files.

CREATE PROCEDURE CopyRFH2Header(IN OutputRoot REFERENCE, IN EncodingRef INTEGER, IN CharSetIdRef INTEGER) BEGIN

SET OutputRoot.MQMD.Format = 'MQRFH2 ';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR ';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding = EncodingRef;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = CharSetIdRef;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Flags = 0;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.mcd.Msd = 'xml';
SET OutputRoot.MQRFH2.jms = '';

END;


Inside message flow compute module i call the procedure in a following manner:

CALL CopyMessageHeaders();

DECLARE FINAL_OUTREF REFERENCE TO OutputRoot;
CALL CopyRFH2Header(FINAL_OUTREF, InputRoot.MQMD.Encoding, InputRoot.MQMD.CodedCharSetId);

But the MQRFH2 header is not set. If you copy the lines of the procedure and paste it after CALL CopyMessageHeaders(), it works fine.

Any idea why same cannot be set using separate procedure call.

Thanks in advance.

Zico
Back to top
View user's profile Send private message
mlafleur
PostPosted: Mon Jul 31, 2006 3:00 pm    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2004
Posts: 73

http://www.mqseries.net/phpBB2/viewtopic.php?t=10595&highlight=reference+outputroot
Back to top
View user's profile Send private message
zico
PostPosted: Tue Aug 01, 2006 5:53 am    Post subject: Reply with quote

Novice

Joined: 22 Jun 2005
Posts: 21

I tried the same way to pass OutputRoot directly as parameter but it does not work. My purpose is to set

SET OutputRoot.MQMD.Format = 'MQRFH2 ';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR ';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding = EncodingRef;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = CharSetIdRef;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Flags = 0;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.mcd.Msd = 'xml';
SET OutputRoot.MQRFH2.jms = '';

in a external procedure which is stored in a diff .esql file.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 01, 2006 5:59 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You missed the important part of the link that was posted.

If you pass a reference to OutputRoot, and create a new field that requires a parser, the parser will NOT be automatically associated.

So you need to specifically create the field with the parser first.

So if you're adding OutputRoot.MQRFH2, you need to create MQRFH2 with the MQRFH2 parser. Then you can set the children of it without having to assign the parser directly.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
zico
PostPosted: Tue Aug 01, 2006 6:52 am    Post subject: Reply with quote

Novice

Joined: 22 Jun 2005
Posts: 21

jefflowrey,

I also did the same way as u mentioned. Please find the codes inside the procedure

CREATE PROCEDURE CopyRFH2Header(IN OutputRoot REFERENCE, IN EncodingRef INTEGER, IN CharSetIdRef INTEGER ) BEGIN


SET OutputRoot.MQMD.Format = 'MQRFH2 ';
CREATE FIELD OutputRoot.MQRFH2;
DECLARE refRequest REFERENCE TO OutputRoot.MQRFH2;

SET refRequest.(MQRFH2.Field)Version = 2;
SET refRequest.(MQRFH2.Field)Format = 'MQSTR ';
SET refRequest.(MQRFH2.Field)Encoding = EncodingRef;
SET refRequest.(MQRFH2.Field)CodedCharSetId = CharSetIdRef;
SET refRequest.(MQRFH2.Field)Flags = 0;
SET refRequest.(MQRFH2.Field)NameValueCCSID = 1208;
SET refRequest.mcd.Msd = 'xml';
SET refRequest.jms = '';


END;

I call the procedure following way:
CALL CopyRFH2Header(OutputRoot,InputRoot.MQMD.Encoding, InputRoot.MQMD.CodedCharSetId);
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 01, 2006 6:53 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's not the right CREATE statement.

Go back and read the posted link again, CAREFULLY.

And THINK.

And look up the options on the CREATE statement.
_________________
I am *not* the model of the modern major general.
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 » Cannot set MQRFH2 header
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.