Author |
Message
|
pmbsa |
Posted: Tue Aug 07, 2001 7:24 am Post subject: |
|
|
Novice
Joined: 06 Aug 2001 Posts: 16
|
Hi, I hve created a MRM to parse a message, the only thing that is constant about the message is the first 100 bytes, the rest of the message is delimited and as a result is not 'MRM friendly' we also know that the message will never exceed 1100 bytes.
Now the Message I have defined in MQSI has 2 fields, one of 100 bytes and another of 1000 bytes, now I thought I should be able to send in a message of any length (Much like you can do in a cobol program) and the parser would just select the first 100 bytes for the first field and what is left over would easily fit into the 1000 byte second field, much to my horror the parser checks that the number of bytes is exacly the same as the field length, even though when you define the length the description on the tab specifically says 'Maximum length' implying that it could be smaller but will never be bigger.
Is there a way around this, it seem to be a very silly limitation.
Thanks
Paul |
|
Back to top |
|
 |
kolban |
Posted: Tue Aug 07, 2001 8:34 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
If you want the first 100 bytes parsed and the remainder treated as a blob of data, you have some choices.
You could use the NEON parser and describe the first 100 bytes as fields and the remainder as a variable length field.
Or you could read the whole message in as a single BLOB of data, substring the first 100 bytes and then pass this through a reset content descriptor to map to an MRM template of the first 100. The remainder could be cached away in the DestinationList subtree. |
|
Back to top |
|
 |
pmbsa |
Posted: Wed Aug 08, 2001 12:55 am Post subject: |
|
|
Novice
Joined: 06 Aug 2001 Posts: 16
|
Cheers, I will give the 2nd option a try, we are using Neon but we are trying to restrict its use were we can, We thought about using it for this but it seemed like over kill.
I cant understand why IBM have made MRM's so useless
|
|
Back to top |
|
 |
huebi |
Posted: Mon Aug 13, 2001 11:46 pm Post subject: |
|
|
Novice
Joined: 01 Jul 2001 Posts: 16
|
Quote: |
On 2001-08-08 01:55, pmbsa wrote:
Cheers, I will give the 2nd option a try, we are using Neon but we are trying to restrict its use were we can, We thought about using it for this but it seemed like over kill.
I cant understand why IBM have made MRM's so useless
|
Can you post your solution? I'm stucked up in this silly MRM limitation, too, and i dont want to use NEON, too.
thx
Rainer |
|
Back to top |
|
 |
huebi |
Posted: Tue Aug 14, 2001 3:42 am Post subject: |
|
|
Novice
Joined: 01 Jul 2001 Posts: 16
|
Quote: |
Or you could read the whole message in as a single BLOB of data, substring the first 100 bytes and then pass this through a reset content descriptor to map to an MRM template of the first 100. The remainder could be cached away in the DestinationList subtree.
|
Hi,
could you please more specific on how to "cache away" the remainder in a DestiantionList subtree? I have a similar Problem, i have messages varying in size, but all of them have three fixed structures ahead and i'm not interested to parse the rest of the message. And i want to avoid NEON.
|
|
Back to top |
|
 |
kolban |
Posted: Tue Aug 14, 2001 4:00 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Folks, don't have my MQSI system with me today so can't compose a sample message flow. If this description isn't sufficient, please let me know and I'll try and craft a sample.
Wish we had the capability to post images here ... if so, I'd craft some diagrams to make it easy ... ok ... here goes.
Create an MQInput node with parser type BLOB. When the message is received by the node, it will be inserted into the message tree at Root.BLOB.BLOB. The content will be a single field byte array.
Next, assume we are only interested in the first 100 bytes but want to save the rest.
To save the 101st byte to the end ...
SET OutputDestinationList.MyData = SUBSTRING(InputRoot.BLOB.BLOB FROM 101);
SET OutputRoot.BLOB.BLOB = SUBSTRING(InputRoot.BLOB.BLOB FROM 1 FOR 100);
You will now have a message tree that contains only the first 100 bytes and the remainder will be in the DestinationList tree. If you now pass into a ResetContentDescriptor, the 100 bytes can be mapped to a structure while the DestinationList tree is left un-touched.
[ This Message was edited by: kolban on 2001-08-14 05:01 ] |
|
Back to top |
|
 |
dutchman |
Posted: Tue Aug 14, 2001 5:17 am Post subject: |
|
|
Acolyte
Joined: 15 May 2001 Posts: 71 Location: Netherlands
|
Just to let you know, the compute node gives a syntax error - but you can ignore it.
It seems to object to InputRoot.BLOB.BLOB and the cursor goes to the first BLOB field.
Cheers ... Ruud |
|
Back to top |
|
 |
kolban |
Posted: Tue Aug 14, 2001 5:49 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Rudd,
Man am I busted. We have discussed this problem previously and I claimed that I always quoted my BLOBs as a matter of practice
See topic for the solution. |
|
Back to top |
|
 |
huebi |
Posted: Thu Aug 16, 2001 12:01 am Post subject: |
|
|
Novice
Joined: 01 Jul 2001 Posts: 16
|
Hi,
would be nice to an example. Can you export a sample message flow to XML and put it somehwere to download it? |
|
Back to top |
|
 |
kolban |
Posted: Thu Aug 16, 2001 2:50 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Ok guys, by popular demand ... a working example:
In this story, my message begins with 15 bytes that maps to:
Field1 - char 5
Field2 - char 5
Field3 - char 5
I put a message in the queue which contains:
ABCDE12345ABCDEThis is some more text
The trace at "trace1" node contains:
(0x1000008)MRM = (
(0x3000001)field1 = 'ABCDE'
(0x3000001)field2 = '12345'
(0x3000001)field3 = 'ABCDE'
)
(0x1000000)BLOB = (
(0x3000000)BLOB = X'5468697320697320736f6d65206d6f72652074657874'
)
The following is the message flow image:
An export of the message flow can be downloaded here
[ This Message was edited by: kolban on 2001-08-16 16:03 ] |
|
Back to top |
|
 |
Nick Lethbridge |
Posted: Fri Aug 17, 2001 4:28 am Post subject: |
|
|
 Voyager
Joined: 13 Aug 2001 Posts: 88 Location: Santander, UK
|
ALthough veering well off the topic of not being able to specify an MRM template with variable length fields, I have an associated question........
We have a CWF header followed by an XML document, I have used a reset content descripter to map to a MRM template for the CWF header and cached the XML as a BLOB in the DistributionList subtree.
Any ideas on how I can parse the XML, so that I can construct a CWF output message based on data fields in both the original CWF header and XML document ? |
|
Back to top |
|
 |
kolban |
Posted: Fri Aug 17, 2001 7:08 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
1. Read in the data as BLOB
2. Substring the MRM data
3. Substring the XML data and save into Destination List
4. Pass through RCD node - parser MRM
5. Move the MRM tree to destination list
6. Move the binary Blob XML to message tree
7. Pass through RCD node - parser XML
At this point you will have both MRM and XML data available .. can map fields as needed. |
|
Back to top |
|
 |
Nick Lethbridge |
Posted: Wed Aug 22, 2001 8:29 am Post subject: |
|
|
 Voyager
Joined: 13 Aug 2001 Posts: 88 Location: Santander, UK
|
Thanks for that Neil, it worked a treat.
However, I struggled for a while to get the reset content descripter to parse the XML.
It was only when I stripped off
from the incoming XML "BLOB" cached in the DestinationList, that it worked.
Is this a bug with the MQSI XML parser (since the Message Display & Test utility provided in the IH03 Support Pack parsed the XML ok and deemed it to be "well formed")? |
|
Back to top |
|
 |
Nick Lethbridge |
Posted: Wed Aug 22, 2001 8:34 am Post subject: |
|
|
 Voyager
Joined: 13 Aug 2001 Posts: 88 Location: Santander, UK
|
Whoops, I guess it is not a good idea to embed XML in HTML !
The bit I had to remove was the XML descriptor and DOCTYPE fields:
"?xml version="1.0" encoding="ISO-8859-1" ?
!DOCTYPE TSN_DATA SYSTEM "TSN.dtd"
|
|
Back to top |
|
 |
jhalstead |
Posted: Thu Aug 23, 2001 1:09 am Post subject: |
|
|
 Master
Joined: 16 Aug 2001 Posts: 258 Location: London
|
Very interested at having a look at Kolbans solution, however the export file doesn't want to load up ...
BIP0056E Cannot read the XML file for a resource.
This is an internal error.
The following errors occured when parsing the XML file: TOPIC1.XML
At line 11 before column 121, Attribute, "useDefaults", is not declared in element, "MessageProcessingNodeType".
Anyone else tried it?
Jamie |
|
Back to top |
|
 |
|