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 » Incorrect MQRFH2 position...

Post new topic  Reply to topic
 Incorrect MQRFH2 position... « View previous topic :: View next topic » 
Author Message
Testo
PostPosted: Thu Dec 04, 2003 2:10 am    Post subject: Incorrect MQRFH2 position... Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

I've developed the eSQL below:

DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.Properties.MessageFormat = 'SWIFT';

SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;

SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)StrucLength = MQRFH_STRUC_LENGTH_FIXED_2 + 224;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodeCharSetId = 500;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = MQFMT_STRING;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;

SET OutputRoot.MQRFH2.ComIbmFml.Version = '1.0';
SET OutputRoot.MQRFH2.ComIbmFml.Payment.Msg_type = 'S' || Environment.Variables.msg;
SET OutputRoot.MQRFH2.ComIbmFml.Payment.Message_format = 'SWIFT';
SET OutputRoot.MQRFH2.ComIbmFml.Payment.Schedule.Schedule_date = '2003-12-04';
SET OutputRoot.MQRFH2.ComIbmFml.User.User_ref = 'BRLI888888888888';

SET "OutputRoot"."MRM"."MessageString" = "InputBody"."MessageString";


The expected output is:

<mcd>
<Msd>mrm</Msd>
<Fmt>SWIFT</Fmt>
</mcd>
<ComIbmFml>

<Version>1.0</Version>
<Payment>
<Msg_type>S103</Msg_type>
<Message_format>SWIFT</Message_format>
<Schedule>
<Schedule_date>2003-12-04</Schedule_date>
</Schedule>
</Payment>
<User>
<User_ref>BRLI888888888888</User_ref>
</User>
</ComIbmFml>

while I get the same result but with <ComIbmFml> folder on top:

<ComIbmFml>
<Version>1.0</Version>
<Payment>
<Msg_type>S103</Msg_type>
<Message_format>SWIFT</Message_format>
<Schedule>
<Schedule_date>2003-12-04</Schedule_date>
</Schedule>
</Payment>
<User>
<User_ref>BRLI888888888888</User_ref><mcd>
<Msd>mrm</Msd>
<Fmt>SWIFT</Fmt>
</mcd>
</User>
</ComIbmFml>
<mcd>

<Msd>mrm</Msd>
<Fmt>SWIFT</Fmt>
</mcd>

Any hint?
Thanks,
Andrea Tedone
Back to top
View user's profile Send private message Send e-mail MSN Messenger
vmcgloin
PostPosted: Thu Dec 04, 2003 3:29 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

I don't know why you are getting it in this order. Maybe you have already got it set up like this before entering this compute node? What does a trace of ${Root} before this show? Does it matter? If it does, then you could use dynamic references to move things to the right place. For example:

Code:
IF ("OutputRoot"."MQRFH2"."ComIbmFml" IS NOT NULL) THEN      
   -- Declare the dynamic reference
   DECLARE Ref REFERENCE TO "OutputRoot"."MQRFH2"."ComIbmFml";
   -- Move the dynamic reference to the next item in the array
   DETACH Ref;
   ATTACH Ref TO "OutputRoot"."MQRFH2"."mcd" AS NEXTSIBLING;
END IF;
Back to top
View user's profile Send private message
Testo
PostPosted: Thu Dec 04, 2003 3:54 am    Post subject: Thanks Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

It now works properly, thank you.
Cheers,
Andrea Tedone
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Incorrect MQRFH2 position...
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.