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 » XML to Cobol transformation

Post new topic  Reply to topic
 XML to Cobol transformation « View previous topic :: View next topic » 
Author Message
bpugh
PostPosted: Fri Jun 18, 2004 12:59 pm    Post subject: XML to Cobol transformation Reply with quote

Novice

Joined: 27 Apr 2004
Posts: 24
Location: St. Louis, MO

I have been reviewing messages on this forum all day, and although I have seen many messages dealing with the same problem I am having, I have been unsuccessful getting anything to work.

I am trying to convert an XML message to CWF Cobol copybook format (just like a lot of other people apparently). Everything seems to go just fine until I get to my MQOutput node. At that point, my trace shows that the output message is empty and it rolls back. I am still pretty new to WMQI and would appreciate any advice you might be able to offer.

Thanks!

My flow looks like:

MQInput --> Try Catch --> Compute --> Trace1 --> MQOutput
|
V
Error Trace

ESQL in the compute node looks like:

CREATE COMPUTE MODULE ReformatMsg
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN

DECLARE OutRef REFERENCE TO OutputRoot.MRM;
DECLARE I INTEGER;

SET I = 1;
WHILE I < CARDINALITY(InputRoot.*[]) DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;

SET OutputRoot.Properties.MessageSet = 'D8DH3KG002001';
SET OutputRoot.Properties.MessageType = 'msg_UPSBBASE_SFGD_BASE_RCD';
SET OutputRoot.Properties.MessageDomain = 'MRM';
SET OutputRoot.Properties.MessageFormat = 'CWF1';


SET OutRef.UPSBBASE_TYPE_ORD = InputBody.special_products.order_type;
SET OutRef.UPSBBASE_CODE_SUB_CMPY_ORD = InputBody.special_products.order_number.booking_agt_co;
SET OutRef.UPSBBASE_NBR_BOKR = InputBody.special_products.order_number.booking_agt_number;
SET OutRef.UPSBBASE_NBR_ORD = InputBody.special_products.order_number.order_sequence_number;
... and so on ...
PROPAGATE;
END;
END MODULE;

The Trace Node "Trace1" shows:

(0x01000000):Properties = (
(0x03000000):MessageSet = 'D8DH3KG002001'
(0x03000000):MessageType = 'msg_UPSBBASE_SFGD_BASE_RCD'
(0x03000000):MessageFormat = 'CWF1'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = TRUE (0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2004-06-18 20:03:00.600'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 5
(0x03000000):ReplyIdentifier = X'0000000000000000000000000000000000000000000
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'ORDER.XML.UPLOAD'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 5
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'c3e2d840e4e3d8d44040404040404040bb6385396
(0x03000000):CorrelId = X'00000000000000000000000000000000000000000
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = '
(0x03000000):ReplyToQMgr = 'TQMGR
(0x03000000):UserIdentifier = 'XXXXX '
(0x03000000):AccountingToken = X'1a0fe4e3d8d4c3c8c9d5f1f9c6c4c6c3f3f00019f
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 's\Desktop\rfhutilc.exe'
(0x03000000):PutDate = DATE '2004-06-18'
(0x03000000):PutTime = GMTTIME '20:03:00.600'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'00000000000000000000000000000000000000000
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)

These are the fields in the COBOL copybook I am moving the data to, so this looks good:

(0x03000000):UPSBBASE_TYPE_ORD = 'S'
(0x03000000):UPSBBASE_CODE_SUB_CMPY_ORD = 'U'
(0x03000000):UPSBBASE_NBR_BOKR = '00980'
(0x03000000):UPSBBASE_NBR_ORD = '82238'
... and so on ...

(0x03000000):MessageSet = 'D8DH3KG002001'
(0x03000000):MessageType = 'msg_UPSBBASE_SFGD_BASE_RCD'
(0x03000000):MessageFormat = 'CWF1'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2004-06-18 20:03:00.600'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 5
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
) ..' '


But the error log shows:

RecoverableException BIP2617E: Output message is empty; output node 'OrderUploadMsgFlow.MQOutput'.
The WebSphere Business Integration Message Brokers output node 'OrderUploadMsgFlow.MQOutput' has received a message to write to an WebSphere Business Integration output queue, but the message appears to be empty. This error may be generated when 1) there is no MQMD and no message content in the output bitstream (there really is no data) or 2) there is no MQMD and the size of the message content is less that the size of the MQMD (it appears there is no content). This situation can occur when a output message is built incorrectly using the Compute node.
Check the message flow to determine whether the message is being built correctly. If not, correct the problem and redeploy the broker.
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Jun 18, 2004 2:04 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Are you creating more than one output message from single input message? I am asking this because I saw PROPAGATE statement in your code, but I did not see any return statement. When using propagate statement, you need to remember couple of things,
1) After execution PROPAGATE statement it will empty your output tree. So when creating next message you will have to re-build all headers from scratch.
2) After last PROPAGATE statement execution, you must return FALSE, so that the execution will end here.

It seems in your case PROPAGATE statement is not needed at all.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
bpugh
PostPosted: Sat Jun 19, 2004 3:11 pm    Post subject: Reply with quote

Novice

Joined: 27 Apr 2004
Posts: 24
Location: St. Louis, MO

Yes, I will be creating multiple output messages for a single input message. My project involves accepting a single XML file containing order master and detail information. I will then parse the data into cobol copybooks that correspond to the master and detail files and place those messages onto the output queue to be processed by an existing cobol program.

I am now just trying to get the master part working, which is why you saw a propagate with nothing else. Once that's working, I planned on dealing with the detail data. I can take the propagate out, but I will need it later.
Back to top
View user's profile Send private message
djeripo
PostPosted: Sat Jun 19, 2004 3:52 pm    Post subject: Reply with quote

Master

Joined: 25 Jan 2004
Posts: 225

Quote:
This error may be generated when 1) there is no MQMD and no message content in the output bitstream (there really is no data) or 2) there is no MQMD and the size of the message content is less that the size of the MQMD (it appears there is no content). This situation can occur when a output message is built incorrectly using the Compute node.
Check the message flow to determine whether the message is being built correctly. If not, correct the problem and redeploy the broker
.

From that, I feel your output message is not constructed properly and also I see in your code , there is no MQMD copied to the OutputRoot .
Are you copying entire message or only messsage headers ?
I would suggest you try copy only MessageHeaders and include this code
SET OutputRoot.Properties = NULL;
SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.MQMD = NULL;
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MRM = NULL;
before your code
SET OutputRoot.Properties.MessageSet = 'D8DH3KG002001';

[/quote]
Back to top
View user's profile Send private message Visit poster's website
TonyD
PostPosted: Sat Jun 19, 2004 4:34 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Quote:
...which is why you saw a propagate with nothing else..

...in that case I would suggest that you comment out PROPAGATE; at the moment the statement is being executed and, as pointed out, empties the tree and MUST be followed by a 'Return False'. I am sure you will find that you then write a valid output message.
Back to top
View user's profile Send private message Send e-mail
bpugh
PostPosted: Wed Jun 23, 2004 2:11 pm    Post subject: Reply with quote

Novice

Joined: 27 Apr 2004
Posts: 24
Location: St. Louis, MO

Thank you all for your comments. It took me awhile, but I think I got it going. Along with your suggestions, there was one other thing I had to do that I didn't know about. My cobol records have filler at the end and I was not initializing it. Once I set the filler to blanks, along with the things you guys suggested, it worked fine.

Thanks again!
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Jun 23, 2004 2:19 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

You can also use Default Constraints for MRM elements to assign default values. FILLER is perfect example for such condition.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML to Cobol transformation
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.