Author |
Message
|
pfaulkner |
Posted: Wed Oct 22, 2003 1:20 pm Post subject: How to determine the length of an output message |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
I have a compute node that builds my output message (which is variable length). Within the message there are several fields that need to contain the length of various poritions of the message.
Is the a way I can get the length of a poriton of my message as I build it.
Assuming I have populated all the fields in the message set and my message looks like this in the MRM:
MRM
HEADER1
SEGMENT1_LENGTH
SEGMENT1
FIELDA ('ABC')
FIELDB ('12345')
HEADER2
SEGMENT2_LENGTH
SEGMENT2
FIELDC('XYZ')
I would want to get the length of SEGMENT1. SEGMENT2 etc and populate SEGMENT1_LENGTH, SEGMENT2_LENGTH |
|
Back to top |
|
 |
JLRowe |
Posted: Fri Oct 24, 2003 1:41 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
The direction you need to look in is embedded messages for your segments, I'm not sure if MRM will allow you to populate an element with the length of an embedded message. So, you may have to use ASBITSTREAM to work out the length of each embedded message and populate the length fields yourself. |
|
Back to top |
|
 |
pfaulkner |
Posted: Fri Oct 24, 2003 9:53 am Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
I tried using ASBITSTREAM but didnt have any luck.
I couldn't find any doc on this function so I was guessing how to use it but this is what I tried:
SET "OutputRoot"."MRM"."TRANSMISSION_HEADER"."TH10_TRNSM_HDR_SEG"."TH10_BLK_CNTL"."TH10_BLK_LEN" =
length(ASBITSTREAM("OutputRoot"."MRM"."TRANSMISSION_HEADER" SET 'DU543NS07Q001' TYPE 'LORAX_V1' FORMAT 'CWF'));
Problem is the result was the length of my complete MRM structure and not just the "OutputRoot"."MRM"."TRANSMISSION_HEADER" portion????
Any idea what I did wrong? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 24, 2003 10:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
pfaulkner wrote: |
I tried using ASBITSTREAM but didnt have any luck.
I couldn't find any doc on this function so I was guessing how to use it |
The doc is in the Readme for CSD03 and later. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JLRowe |
Posted: Fri Oct 24, 2003 11:15 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
There's an option in ASBITSTREAM() to specify you only want the folder (i.e. the subtree you specify), not the whole message.
Look at the docs. |
|
Back to top |
|
 |
pfaulkner |
Posted: Fri Oct 24, 2003 12:44 pm Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
tried that but I guess it's not supported with an MRM
2003-10-24 14:37:03.104280 3646 ParserException BIP5379E: Invalid option 'FolderBitStream'
An ESQL operation included the use of 'FolderBitStream'. The MRM Domain does not support this option.
Check your ESQL, and ensure that you do not use the option 'FolderBitStream' when working with messages in the MRM Domain. |
|
Back to top |
|
 |
|