Author |
Message
|
Luca81 |
Posted: Wed Jun 13, 2007 10:58 am Post subject: MRM TDS Padding problem |
|
|
Acolyte
Joined: 01 Mar 2007 Posts: 62
|
Hi all.
I have other problem with MRM (TDS) format.
I have to comunicate with AS/400 and i have an XML like input.
I have to map XML on MRM (TDS)
The message is very big (about 30 elements). The elements are all String or Decimal (min occ 1, max occ 1).
First I initialize (like IBM suggests) all elements. The order is the same of the Message Set Definition.
SET OutputRoot.MRM.Message.Element1 = '';
SET OutputRoot.MRM.Message.Element2 = '';
...
....
SET OutputRoot.MRM.Message.Elementx ='';
Second I set the values in a bad order
SET OutputRoot.MRM.Message.Element2 = InputRoot.XML.Message.El1;
SET OutputRoot.MRM.Message.Element3 = InputRoot.XML.Message.El2;
...
...
SET OutputRoot.MRM.Message.Element1 = InputRoot.XML.Message.El3;
I have 3 decimals so defined
Lenght: 2
Justification: Right Justify
Padding Char: '0'
Vertual Decimal Point: 0
Signe Orientation: Leading
So if XML element is, for example, 3 I have 03 like output.
All works fine except with one decimal .
For 2 decimals I have the correct output (xml element with padding).
For one decimal the padding does not work . If i have 3 like input... I have 3 like output and not 03...
The 3 decimals are declared with the same properties.
Could be a set order problem?
Pls help me 
Thx a lot
Luca |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 13, 2007 2:34 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
The message is very big (about 30 elements) |
Either each element is very big, or that's a fairly small message
Quote: |
For one decimal the padding does not work . If i have 3 like input... I have 3 like output and not 03... |
What is the content of the source element in each case? Are they all the same ESQL type in ( CHARACTER / DECIMAL/... )?
Quote: |
Could be a set order problem? |
I doubt it.
- Double check that the properties are the same on all 3 elements ( check in the mxsd file to be certain )
- Take a user trace of the parse, and look for warnings about self-defining elements ( I'm assuming that you are on v6 ). |
|
Back to top |
|
 |
Luca81 |
Posted: Wed Jun 13, 2007 9:43 pm Post subject: |
|
|
Acolyte
Joined: 01 Mar 2007 Posts: 62
|
[quote="kimbert"]
Quote: |
Either each element is very big, or that's a fairly small message  |
Quote: |
What is the content of the source element in each case? Are they all the same ESQL type in ( CHARACTER / DECIMAL/... )? |
All have the same content... DECIMAL.
Quote: |
- Double check that the properties are the same on all 3 elements ( check in the mxsd file to be certain )
|
Done 4 times 
Quote: |
- Take a user trace of the parse, and look for warnings about self-defining elements ( I'm assuming that you are on v6 ). |
I don t have warning  . And I m on version 5.0 CSD 10
The exactly istruction is
SET refOut.GGCalcdataValMovCash = COALESCE(refCashFlow.*:OtherMovSpotDays,'00');
If I correct with
SET refOut.GGCalcdataValMovCash = RIGHT('0'||COALESCE(refCashFlow.*:OtherMovSpotDays,'00'),2);
All work fine. But this is not good... WBI should padding my string 
Pls help me
thx
Luca |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 14, 2007 12:39 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I don t have warning |
You won't get those warnings unless you are on v6. You can still check for self-defining elements, though. Just enable validation in your message flow, and you will get a validation error if the message tree does not match your message definitions. |
|
Back to top |
|
 |
Luca81 |
Posted: Thu Jun 14, 2007 1:11 am Post subject: |
|
|
Acolyte
Joined: 01 Mar 2007 Posts: 62
|
kimbert wrote: |
Quote: |
I don t have warning |
You won't get those warnings unless you are on v6. You can still check for self-defining elements, though. Just enable validation in your message flow, and you will get a validation error if the message tree does not match your message definitions. |
I enabled validation... But i don't have warning because the message tree matches my message definitions .
This is tha trace
Executing statement 'SET refOut.GGCalcdataValMovCash = COALESCE(refCashFlow.*:OtherMovSpotDays, '00');' at (Ordine.DB_AnaContrReq.Main, 196.3).
Evaluating expression 'COALESCE(refCashFlow.*:OtherMovSpotDays, '00')' at (Ordine.DB_AnaContrReq.Main, 196.3 .
Evaluating expression 'refCashFlow.*:OtherMovSpotDays' at (Ordine.DB_AnaContrReq.Main, 196.47).
Assigning value ''2'' to field / variable 'refOut.GGCalcdataValMovCash'.
All is ok... The problem is the padding 
thx
Luca |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 14, 2007 1:54 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Are all 3 decimals members of a Fixed Length structure ( i.e. Data Element Separation of parent is 'Fixed Length') ? |
|
Back to top |
|
 |
Luca81 |
Posted: Thu Jun 14, 2007 2:07 am Post subject: |
|
|
Acolyte
Joined: 01 Mar 2007 Posts: 62
|
kimbert wrote: |
Are all 3 decimals members of a Fixed Length structure ( i.e. Data Element Separation of parent is 'Fixed Length') ? |
All decimals have the same parent...
The structure is easy... a lot elements with all the same parent...
The parent has 'Fixed Length' for Data Element Separation
  |
|
Back to top |
|
 |
|