Author |
Message
|
goldym |
Posted: Tue Feb 27, 2007 10:37 am Post subject: CAST Function |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
I have a message coming in the MRM domain:
1. I have to RESET it to BLOB in order to Calculate the length
2. Then CAST it back to MRM in order to store the value in a field A.
3. Then once I get the Length I have to RESET it to Blob again to get the New Length that includes the field A
4. Then CAST back to MRM in order to store the new length in field A
Is it possible to do this using the CAST funtion instead of using 4 RCD nodes? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Feb 27, 2007 10:54 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't do this with CAST at all.
You need to use ASBITSTREAM and CREATE FIELD... PARSE. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
goldym |
Posted: Tue Feb 27, 2007 11:15 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
I would use ASBITSTREAM and CREATE FIELD... PARSE to Change the domain from MRM to BLOB and the reverse?
[quote="jefflowrey"]You can't do this with CAST at all.
You need to use ASBITSTREAM and CREATE FIELD... PARSE.[/quote] |
|
Back to top |
|
 |
special_agent_Queue |
Posted: Tue Feb 27, 2007 12:32 pm Post subject: |
|
|
 Centurion
Joined: 27 Jul 2006 Posts: 102
|
Yes, that's what he said... |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 27, 2007 12:58 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And remember if this is XML in the MRM domain you will have to do at least one more round trip (very costly).
Could you please be a little bit more specific as to what you are trying to achieve and why?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
goldym |
Posted: Tue Feb 27, 2007 1:35 pm Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
fjb_saper - I need to calculate the total length of the TDS record twice because I need the total length including the length field. Do you have any suggestions?
Its not XML its TDS.
[quote="fjb_saper"]And remember if this is XML in the MRM domain you will have to do at least one more round trip (very costly).
Could you please be a little bit more specific as to what you are trying to achieve and why?
Enjoy [/quote] |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Feb 27, 2007 1:39 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Is the length field a variable length field? Are any of the fields that precede length defined as variable length fields?
Is the stuff that surrounds it (tags, delimiters, etc.) fixed in length? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
goldym |
Posted: Tue Feb 27, 2007 1:40 pm Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
The length field and all the other fields are variable length fields not fixed.
[quote="jefflowrey"]Is the length field a variable length field? Are any of the fields that precede length defined as variable length fields?
Is the stuff that surrounds it (tags, delimiters, etc.) fixed in length?[/quote] |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Feb 27, 2007 1:44 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to uncheck the box that says "Disable BBCode in this post".
Is the length field stored as character data, or binary/integer data?
Is the length field tagged on it's own, or just delimited? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
goldym |
Posted: Tue Feb 27, 2007 1:52 pm Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
Is the length field stored as character data, or binary/integer data -
The Length field is being stored as Integer data I am using the LENGTH function to calculate
Is the length field tagged on it's own, or just delimited - i believe it is tagged |
|
Back to top |
|
 |
kimbert |
Posted: Tue Feb 27, 2007 2:46 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please - just give us a short example message. It makes everything so much clearer. |
|
Back to top |
|
 |
goldym |
Posted: Tue Feb 27, 2007 3:34 pm Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
kimbert wrote: |
Please - just give us a short example message. It makes everything so much clearer. |
Sorry here is a small example
1.200:32*1.201:111*1.202:JONES; |
|
Back to top |
|
 |
kimbert |
Posted: Wed Feb 28, 2007 1:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Thanks. Which field is the length field?
And how does this example message relate to these steps?
Quote: |
1. I have to RESET it to BLOB in order to Calculate the length
2. Then CAST it back to MRM in order to store the value in a field A.
3. Then once I get the Length I have to RESET it to Blob again to get the New Length that includes the field A
4. Then CAST back to MRM in order to store the new length in field A |
|
|
Back to top |
|
 |
goldym |
Posted: Wed Feb 28, 2007 6:34 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
So this is the message that I create I map from an incoming XML to this TDS formatted message (using mapping node). I think my message set by default populates the length with a 0, not sure why. 1.200 is the field identifier (tag).
1.200:0*1.201:111*1.202:JONES;
I have to convert this to a blob to get the length of the message.
1.200:0*1.201:111*1.202:JONES;
Then convert back to MRM to populalte the length field
1.200:30*1.201:111*1.202:JONES;
Then convert back to Blob to re-calculate the length to include the length field. It will not always be 2 bytes or 3 bytes it maybe 2,3, or 4.
Convert back to MRM to re-populate the length field with the total length to include the length field
1.200:31*1.201:111*1.202:JONES;
That is my issue because right now I have 4 RCD nodes and 4 compute nodes and I think it has to be a more efficient way
[quote="kimbert"]Thanks. Which field is the length field?
And how does this example message relate to these steps?
[quote] |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 28, 2007 6:43 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What happens if the length field causes the message to go from 4 bytes long to 5 bytes long? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|