|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Convert CWF to XML |
« View previous topic :: View next topic » |
Author |
Message
|
parthiba_s |
Posted: Sun Dec 08, 2002 9:37 am Post subject: Convert CWF to XML |
|
|
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 |
|
 |
kirani |
Posted: Sun Dec 08, 2002 3:31 pm Post subject: |
|
|
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 |
|
 |
lung |
Posted: Sun Dec 08, 2002 4:54 pm Post subject: |
|
|
 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 |
|
 |
parthiba_s |
Posted: Mon Dec 09, 2002 2:11 am Post subject: |
|
|
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 |
|
 |
lung |
Posted: Mon Dec 09, 2002 4:53 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|