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 » Passing InputRoot &OutputRoot as REFERENCE to PROCEDURE

Post new topic  Reply to topic
 Passing InputRoot &OutputRoot as REFERENCE to PROCEDURE « View previous topic :: View next topic » 
Author Message
shalabh1976
PostPosted: Mon Mar 14, 2005 3:48 am    Post subject: Passing InputRoot &OutputRoot as REFERENCE to PROCEDURE Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

I am on WMQI V2.1 CSD 08 and Win 2K Platform.
I am trying to pass InputRoot and OutputRoot as reference to a PROCEDURE as specified here:
http://www.mqseries.net/phpBB2/viewtopic.php?t=10595&highlight=reference

My code is as below:
Code:
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.
--DECLARE IN_TrnsCount, IN_TrnsNo INTEGER;
--SET IN_TrnsNo = CARDINALITY(InputRoot.XML.Data.Transaction[]);
--SET IN_TrnsCount = 1;
--WHILE IN_TrnsCount <= IN_TrnsNo DO
CALL PROC_GenMsg(InputRoot, OutputRoot);
--PROPAGATE;
--SET IN_TrnsCount = IN_TrnsCount + 1;
--END WHILE;



CREATE PROCEDURE PROC_GenMsg( IN InputRoot REFERENCE, IN OutputRoot REFERENCE)
BEGIN
DECLARE Ci INTEGER;
SET Ci = CARDINALITY(InputRoot.*[]);
DECLARE Ii INTEGER;
SET Ii = 1;
WHILE Ii < Ci DO
   CREATE LASTCHILD OF OutputRoot DOMAIN FIELDNAME(InputRoot.*[Ii]);
   SET OutputRoot.*[Ii] = InputRoot.*[Ii];
   SET Ii=Ii+1;
END WHILE;
CREATE LASTCHILD OF OutputRoot DOMAIN 'XML';

--SET OutputRoot.Properties.MessageFormat = 'XML';
CREATE FIELD OutputRoot.XML.VOUCHER_BUILD.FieldTypes;
DECLARE VouchRef REFERENCE to OutputRoot.XML.VOUCHER_BUILD.FieldTypes;
DECLARE IN_HeaderCount, IN_HeaderLoop, IN_TransactionLoop, IN_TransactionCount, IN_LineLoop, IN_LineCount INTEGER;
DECLARE TMP_Var CHAR;
SET OutputRoot.XML.(XML.XmlDecl) = '';
SET OutputRoot.XML.(XML.XmlDecl).(XML.Version) = '1.0';
SET VouchRef.VCHR_VNDR_STG.(XML.Attribute)class = 'R';
SET VouchRef.VCHR_VNDR_STG.BUSINESS_UNIT.(XML.Attribute)type = 'CHAR';
SET VouchRef.VCHR_VNDR_STG.VOUCHER_ID.(XML.Attribute)type = 'CHAR';
SET VouchRef.VCHR_VNDR_STG.NAME1.(XML.Attribute)type = 'CHAR';
SET VouchRef.VCHR_VNDR_STG.EMAILID.(XML.Attribute)type = 'CHAR';
SET VouchRef.VCHR_VNDR_STG.COUNTRY.(XML.Attribute)type = 'CHAR';
SET VouchRef.VCHR_VNDR_STG.ADDRESS1.(XML.Attribute)type = 'CHAR';
SET VouchRef.VCHR_VNDR_STG.ADDRESS2.(XML.Attribute)type = 'CHAR';
SET VouchRef.VCHR_VNDR_STG.ADDRESS3.(XML.Attribute)type = 'CHAR';
END;


When I run this this is the error I get in EVENT VIEWER:
Code:
( MQSI_SAMPLE_BROKER.default ) Source field '4d005100500052004f0050004500520054005900500041005200530045005200' is too long for a target field of length '8' when converting from unicode to codepage '437'.   

When the character data in the source field is converted to the target codepage, the resulting character string was longer than the defined length of the target field.   

Correct the application or compute expression that generated the message. Ensure that the definition of the field in the output message is correctly specified bearing in mind the codepage required for the message and check that the origin of the data within the source field is providing correct data.   


Eventually I need to uncomment my lines at the top so that I can propagate as many messages as the number of transactions in the input.

Any ideas about the error ?
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger 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 » Passing InputRoot &OutputRoot as REFERENCE to PROCEDURE
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.