Author |
Message
|
vmukesh |
Posted: Fri Feb 13, 2004 5:23 am Post subject: Message length of complete MRM |
|
|
Novice
Joined: 30 Dec 2003 Posts: 10
|
Hi,
I am using TDS structure. I need to have the length of the complete MRM in order to place appropriate low values in my last field.
Could you pls let me know how to get the length of complete MRM. I tried
DECLARE len INTEGER;
SET len = LENGTH(InputRoot.MRM);
This doesn't work and as it rerurns NULL thus doen't show the Environment variable also to display the lenth.
Any Suggesstion...
Bye. |
|
Back to top |
|
 |
Missam |
Posted: Fri Feb 13, 2004 6:35 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Do you want complete length including Delimiters or just want the sum of all fields.you can get this by writing a function which loops into all fields get their length and sum it. |
|
Back to top |
|
 |
vmukesh |
Posted: Fri Feb 13, 2004 7:37 am Post subject: |
|
|
Novice
Joined: 30 Dec 2003 Posts: 10
|
Thanks for thr promt reply..
I want to get the complete length of MRM including delimiters. Actually I tried to sum-up the lenth of the elements but ifs any filed comes as null then the whole length becomes NULL and can't be displayed on the trace.
However, I have to get the complete lenth for the MRM. Based on this length I have to fill-up my last field with low-values(X'00').
Any clues...
Thanks. |
|
Back to top |
|
 |
JT |
Posted: Fri Feb 13, 2004 8:37 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Although not very elegant, this could work: use a ResetContentDescriptor node to change the output MRM structure into a BLOB, then in a subsequent compute node derive the length of the binary string, set the value to a localenvironment variable, you'll then need to use another RCD to convert the binary string back into the MRM format. |
|
Back to top |
|
 |
Missam |
Posted: Fri Feb 13, 2004 10:35 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
You got the answer with you.check field exists if yes get the length and add it ot previous sum.if not add 0 to previous sum.just you need is to include one if statement. |
|
Back to top |
|
 |
|