Author |
Message
|
wbiman |
Posted: Mon Aug 16, 2004 6:09 am Post subject: MRM Field Size |
|
|
Voyager
Joined: 13 Jul 2004 Posts: 84
|
Hi Friends,
I have fixed length MRM-CWF Message Set with 10 fields. Is there way/function I can use to get field length/size using ESQL.
Please help
-WBI |
|
Back to top |
|
 |
Lisa |
Posted: Mon Aug 16, 2004 6:21 am Post subject: |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Yes, use the length function
Set mylength = length(field1);
Last edited by Lisa on Tue Aug 17, 2004 9:28 am; edited 4 times in total |
|
Back to top |
|
 |
wooda |
Posted: Mon Aug 16, 2004 7:35 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Hi wbiman,
If you mean can you get the length you have defined in the message set in your ESQL then the answer is no.
Because by the time you are examining the tree in ESQL the length may well have changed from that defined in the message set. This is due to removal of padding on character fields, conversion of encoded numeric fields and removal of extraneous digits in numeric fields. |
|
Back to top |
|
 |
wbiman |
Posted: Tue Aug 17, 2004 5:56 am Post subject: Please help |
|
|
Voyager
Joined: 13 Jul 2004 Posts: 84
|
Hi,
Here's the exact situation. I am trying to convert input data that in XML format to fixed length MRM format. So when I try to map XML fields to MRM Fixed length messageset fields I am getting errors, I can understand its due to XML TAGS/value is greator or lesser that fixed length fields.
So i thought of truncating the XML TAG values to required fixed length. inorder to do that I don't want to hardcode the length/size of fixed length fields of MRM message set.
So I am looking for way I can get the field length/size in ESQL? not the value size........or there's any betterway to do this?
Please help
WBI |
|
Back to top |
|
 |
Lisa |
Posted: Tue Aug 17, 2004 9:20 am Post subject: Lenght |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Yes, if you would like to find the length of your data, use the length function
Set mylength = length(field1);
Is this what your looking for? |
|
Back to top |
|
 |
wooda |
Posted: Tue Aug 17, 2004 11:55 pm Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Ok you last post only added to the confusion. Not sure what you meant by the length of XML TAGS. Surely the length of the tag doesn't matter as it is removed by the XML parser.
Anyway. Here is what I think you mean. Please indicate if this is what you mean :
Input XML
eg.
<msg><field1>somedatafjkdfjkdjf</field1><field2>more</field2></msg>
Output MRM (CWF)
eg. two eight character fields
somedatamoredata
Problem is that the data in XML can be too long for the fixedlength field or too short.
Answer :
If the data is too short this is not a problem. simply use CWF padding to pad to the required length.
If the data is too long then you will have to truncate it yourself in ESQL. You will not be able to query the Length defined in the msgset from ESQL. So you will have to hardcode this into the ESQL.
If this is not what you meant then please give us an example to illustrate what you want. Include an example of the input and the desired output and what problems you are hitting. |
|
Back to top |
|
 |
|