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 » Convert CWF to XML

Post new topic  Reply to topic
 Convert CWF to XML « View previous topic :: View next topic » 
Author Message
parthiba_s
PostPosted: Sun Dec 08, 2002 9:37 am    Post subject: Convert CWF to XML Reply with quote

Novice

Joined: 12 Sep 2002
Posts: 20

Hai
I have CWF Message which I have to convert into XML. The output Structure that I have is abit complicated. The output XML has tag that are bound to repeat. In such cases how can I transform the CWF into XML.
I have Message set of the Incommming message created from a copy book.

Please to suggest any solution , or any other idea as how to convert a CWF to XML

Regards
S.Parthiban
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kirani
PostPosted: Sun Dec 08, 2002 3:31 pm    Post subject: Reply with quote

Jedi Knight

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

Could you post an example of your input and output message here along with your copybook layout.
_________________
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
lung
PostPosted: Sun Dec 08, 2002 4:54 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

S. Parthiban,

If your COBOL copybook involves 'Occurs', then definitely you will know the number of occurences, right? In that case, it will be easy to define your output XML... The particular field in your XML will be repeating, (read on CARDINALITY)

For example, if FieldA in COBOL occurs 3 times, then...
Code:
SET I = 1;
WHILE I <= 3 DO
SET OutputRoot.XML.FieldA[I] = InputBody.FieldA[I];
SET I = I + 1;
END WHILE;

Hope this helps.
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
parthiba_s
PostPosted: Mon Dec 09, 2002 2:11 am    Post subject: Reply with quote

Novice

Joined: 12 Sep 2002
Posts: 20

Hai Kiran/Lung

My input message is CWF

"0001WSC 123456789123451234511234567812345123456781234511212312345678RUN WELL "

And the required output is
an XML



My Copy book is .

000102 01 NEXTDAYORDINFO.
000103 05 NEXTDAYORDCOUNT PIC 9(04).
000103 05 NEXTDAYORDS OCCURS NEXTDAYORDCOUNT TIMES.
000103 15 RECEIVEBRECODE PIC X(04).
000103 10 SSMSHPMNNBR PIC X(09).
000103 10 ORDERNUMBER PIC X(05).
000103 10 WHOLESALERNBR PIC X(05).
000119 10 RECORDINDICATOR PIC X(01).
000119 10 PCSCODEQTYDATA OCCURS 15 TIMES.
000119 15 PCSCODEQTY PIC X(13).
000119 10 SHIPMODE PIC X(01).
000120 10 LOADCODE PIC X(02).
000121 10 FEDERALTAXFLAG PIC X(01).
000122 10 STATETAXFLAG PIC X(01).
000123 10 PLANNEDDATE PIC X(0.
000124 10 INSTRUCTIONS PIC X(50).
000125 10 LOADTIME PIC X(04).
000126 10 CARRIERCODE PIC X(04).
000128 10 AUTHORIZEDDATA OCCURS 15 TIMES.
000129 15 AUTHORIZEDCODE PIC X(03).
000130 15 AUTHORIZEDQTY PIC X(04).
000131 10 PREPAIDLITERAL PIC X(01).
000131 10 OMSSHPMTNBR PIC X(0.
000119 10 STOPNUMBER PIC X(02).
000120 10 DUNNAGEMESSAGE PIC X(50).


The First apparoach I have followed is I have used a

1) MQ Input node seting the Input Domain to MRM and Messafe Format to CWF

2)A compute node with the following ESQL
SET OutputRoot.Properties.MessageFormat = 'XML';
SET OutputRoot.Properties.MessageDomain = 'MRM';

3) MQ Output Node


The Second Approach I have followed is

1)MQ Input Node with Message domain as BLOB
2)RCD node with Message Domain as MRM and Message Format as CWF andlong with message set and Message type values
3)In the compute node
"
SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.

SET OutputRoot.Properties.MessageFormat = 'XML';
SET OutputRoot.Properties.MessageDomain = 'MRM';
"

4)MQ output node
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
lung
PostPosted: Mon Dec 09, 2002 4:53 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

First of all, make sure you added an XML layer to your message set

Now for the element NEXTDAYORDS, you have to set the repeat count type as your NEXTDAYORDCOUNT. Yes, this is done in your message set, no ESQL required. For the rest of the elements which have occurrences (such as PCSCODEQTYDATA) just set the number in your repeat count.

Your first approach should work fine, with input node specifying the domain, format, and of course, your message set. Then in your compute node, just set the messageformat to XML, no resetting of domain required.

Hope this helps. Else... I'm sure Kiran can give a better explaination
_________________
lung
Back to top
View user's profile Send private message Send e-mail 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 » Convert CWF to XML
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.