Author |
Message
|
zico |
Posted: Mon Jul 31, 2006 1:08 pm Post subject: Cannot set MQRFH2 header |
|
|
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 |
|
 |
mlafleur |
Posted: Mon Jul 31, 2006 3:00 pm Post subject: |
|
|
Acolyte
Joined: 19 Feb 2004 Posts: 73
|
|
Back to top |
|
 |
zico |
Posted: Tue Aug 01, 2006 5:53 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 01, 2006 5:59 am Post subject: |
|
|
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 |
|
 |
zico |
Posted: Tue Aug 01, 2006 6:52 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 01, 2006 6:53 am Post subject: |
|
|
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 |
|
 |
|