Author |
Message
|
Subha |
Posted: Wed Nov 15, 2006 4:20 am Post subject: Trying to discard fields in output TDS message |
|
|
Apprentice
Joined: 14 Nov 2006 Posts: 33 Location: Toronto
|
I am trying to discard some of the messages elements in the output.Output message is of TDS type. To get that, I am setting the element to NULL using compute node. I did not set any default values in my message definition. But it is throwing error saying "Mandatory element has no value or default value assigned" .
If I give some default values , then field is not getting skipped in the output even though i have assigned it to be NULL.
Please help me.
Thanks! _________________ Subh |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 15, 2006 4:26 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
AkankshA |
Posted: Wed Nov 15, 2006 4:30 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
though a very basic question...
does ur msg set has min count as 0 for the elements u r trying to discard or rather populating as NULL |
|
Back to top |
|
 |
Subha |
Posted: Wed Nov 15, 2006 4:49 am Post subject: Trying to discard fields in output TDS message |
|
|
Apprentice
Joined: 14 Nov 2006 Posts: 33 Location: Toronto
|
Input is XML type and output is TDS message (sequence of fixed length strings).
I referred IBM docs for discarding the fields and i am setting the fields to NULL without giving default values. It gave me exception. I then tried giving default values while setting the fields to NULL in ESQL. No exception is being thrown. But the output has the element which i dont expect to come.
I have given min occurs to be 0 and max occurs 1.
Please let me know if i am not clear. _________________ Subh |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 15, 2006 5:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The first thing to do is not use CopyEntireMessage, just CopyMessageHeaders.
Then build your OutputRoot.MRM. fields in the correct order, only setting the fields that you want to set.
Then go back and look at the documentation link that kimbert posted.
Then make sure you aren't trying to set optional fields in a fixed length structure. If you say that a particular set of fields must be X bytes long, and then you try to only include Z<X bytes worth of data elements... then you're going to have to have a default value.
Then make sure you understand your data model in general. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 15, 2006 5:38 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Your XML input message defines fields A, B, C and D.
Your fixed-length output message contains fields A and D.
You cannot use use same message definition for input and output. The TDS serializer will try to write exactly four fields. If it cannot do that, it will throw an exception ( which is correct behaviour - you might have missed out B and C by mistake ).
You need to define another message type for output, containing only fields A and D. |
|
Back to top |
|
 |
|