Author |
Message
|
datspats |
Posted: Wed Jul 04, 2007 4:48 am Post subject: problem in decimal representation in output queue |
|
|
Voyager
Joined: 12 Apr 2007 Posts: 80 Location: Mumbai
|
Hello all,
I am trying to write to message to a queue with decimal field in the format as below
e.g.
435.54 is mapped to the format 6.3- ie. this should be written to the queue as "000435.540 " i.e 6 digits before decimal point and 3 digits after the decimal point.
and when -435.54 is mapped to the format 6.3- ie. this should be written to the queue as "000435.540-"
My message set has decimal field defined as,
I am defining length as 11 = (9 for digits + 1 for '.' + 1 for "-" (sign of number)).
I am defining padding character as '0'.
When message is written to the queue, I am getting number not expected in above format, Could you please help me on this? Where i am going wrong in defining message set.
Regards |
|
Back to top |
|
 |
datspats |
Posted: Wed Jul 04, 2007 5:58 am Post subject: |
|
|
Voyager
Joined: 12 Apr 2007 Posts: 80 Location: Mumbai
|
Is there any way to achive this please?
Regards |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jul 04, 2007 12:32 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Where i am going wrong in defining message set |
First tell us which domain ( probably MRM, but you did not say ) and which physical format you are using.
Quote: |
I am getting number not expected in above format |
So what are you getting? It's not easy to help unless you supply the facts.
What does the documentation say about this? Do you think it should be possible? |
|
Back to top |
|
 |
datspats |
Posted: Wed Jul 04, 2007 9:06 pm Post subject: |
|
|
Voyager
Joined: 12 Apr 2007 Posts: 80 Location: Mumbai
|
Yes the domain is MRM, the physical format TDS for the message set
What i trying to have field in output message is fixed length decimal value.
Which has the above format as mentioned in my first post. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jul 05, 2007 2:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
kimbert wrote: |
So what are you getting? It's not easy to help unless you supply the facts.
What does the documentation say about this? Do you think it should be possible? |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
datspats |
Posted: Thu Jul 05, 2007 6:40 am Post subject: |
|
|
Voyager
Joined: 12 Apr 2007 Posts: 80 Location: Mumbai
|
When I am trying to map 435.54 to the format 6.3-
I am getting in output as
000043554 |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 05, 2007 6:58 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please list the relevant TDS properties in your message definition |
|
Back to top |
|
 |
datspats |
Posted: Thu Jul 05, 2007 9:56 pm Post subject: |
|
|
Voyager
Joined: 12 Apr 2007 Posts: 80 Location: Mumbai
|
Hi Message set details
Message format: TDS
Complex type
-field1
-field2
-field3
-field4
All the fields are fixed length, they can be string, decimal, int
For the decimal I have set the property as
Length 11
Padding character '0'
and Trailing Sign character
poitive=<no value>
negative= -
Justfication: Right
Precision selected : All significant digits
So I expect the output for value 435.54 as "000435.540 "
and for -435.54 as "000435.540-"
Thats why I said my format would be "6.3-" Number
i.e. 6 character before decimal, 1 for decimal point, 3 for after decimal and finally 1 for sign symbol '-' if negative value.
I think this is clear what i want to do.
Regards |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 06, 2007 2:16 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I am getting in output as
000043554 |
That number has no decimal separator. The docs say that you will always get a decimal separator if you set Precision to 'All significant digits'. So I see 3 possibilities:
a) there's a defect in the product
b) the value in the message tree is not what you thought it was
c) you did not set Precision to All Significant Digits
Two questions:
- Why have you set Precision to 'All Significant Digits'? Why not '3'.
- Have you checked the contents of your decimal element in the message tree ( using a Trace node or the debugger )? |
|
Back to top |
|
 |
|