Author |
Message
|
pfaulkner |
Posted: Tue Sep 30, 2003 8:47 am Post subject: A little help with MRM(XML) required please |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
I want to use MQM(XML) to parse my input message and then convert the output message to BLOB.
Is it possible for the input parsing to any of the following:
Pad the xml fields to the maximum size
Add the xml field and pad if not found
I am trying to build a COBOL message for my output message but due to the complexity of the message I don't want to use the MRM(CWF) parser on the output side. So I need to be able to parse the the input and make sure all the fields supplied are the correct length and are found.
I know in my ESQL I could check if found and also edit each field for length and pad if required but my output message has 2000 fields so I want to do this the easiest possible way.
thanks for any help. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Oct 01, 2003 3:23 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Hi,
You said "...due to the complexity of the message I don't want to use the MRM(CWF) parser on the output side"
I'd be interested to know what the complexities are. Why is it not possible to use CWF on the output side? As you correctly state, that would certainly be the easiest solution. If you can give me a bit more detail, maybe we can find a way of using CWF. |
|
Back to top |
|
 |
pfaulkner |
Posted: Wed Oct 01, 2003 7:38 am Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
sure,
take a look at http://www.mqseries.net/phpBB2/viewtopic.php?t=10940
it's a post that I asked for help on the design where I was considering using MRM(CWF) on the output side. I didn't get any responses and decided to change my approach to try and validate the data coming in with XML(CWF) instead of on the output side.
thanks |
|
Back to top |
|
 |
kimbert |
Posted: Thu Oct 02, 2003 1:24 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
OK - I've looked at the previous post. You seem to have an input XML message which is something like this....
<TransmissionHeader>
<Segment1></Segment1>
<Segment1></Segment1>
<Segment99></Segment99>
<Segment5></Segment5>
<Segment5></Segment5>
</TransmissionHeader>
Based on what I've seen, I think you could model each segment as a separate compound element within the same message set. Then, you could model the TransmissionHeader as either
a) a repeating choice, where the choice contains all the segment elements.
b) an unordered set containing all the segment elements, with minOccurs set to 0 for each member of the unordered set.
By setting the CWF properties on each segment (and its child elements) you should be able to avoid the need for any custom ESQL. |
|
Back to top |
|
 |
pfaulkner |
Posted: Thu Oct 02, 2003 7:28 am Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
thanks
let me add a little more info.
You were close on the structure but that's the output structure. The input structure is fixed structure that just contains simple elements (based on the element values I know which of the 25 segments I need to build).
The output structure would be like this (except in a COBOL/C format)
<Root>
<TransmissionHeader>
</TransmissionHeader>
<Segment1>
<SegmentHeader/>
<Segment1Data>
</Segment1>
<Segment21>
<SegmentHeader/>
<Segment21Data>
</Segment21>
<Segment11>
<SegmentHeader/>
<Segment11Data>
</Segment11>
</Root>
The SegmentHeaders all have identical structures. I like your idea but the main problem I see is that some of my Segments contain variable length tables and are built on the fly based on the input message.
For example:
If I have 5 accounts in my input message, my output segment11 would contains 5 occurances of the account data. Now unless I am mistaken in a CWF you have to either define a fixed size table (occurs=x) or a variable length table that is dependent on a field in the same structure (occurs 0 to 10 dependent on NumberOfAccounts). Problem is I don't have a field in my output structure that holds the number of Accounts.
thanks for the input. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 03, 2003 2:04 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
OK - now I see your problem.
There may be one other thing you could try. You could add an extra integer element to the enclosing compound type, and use this to set the number of repeats. Then you could use the ASBITSTREAM function to invoke the CWF parser and produce an output bitstream which is almost correct.
If you know the offset and length of the extra integer element, you can then chop it out of the bitstream using some custom ESQL. |
|
Back to top |
|
 |
|