Author |
Message
|
Veera B |
Posted: Wed Feb 06, 2013 2:31 am Post subject: Optional Field Parsing error |
|
|
Voyager
Joined: 16 Jan 2013 Posts: 76
|
Hi All,
I am having a message set of mostly character fields but inbetween having few integer ones. All the fields are optional.
There is no parsing error if i give all fields in input message and also give blank for character fields, but if i dont give input data for Integer fields the parsing will stop at that point and further elements are not processed, even though it is optional field.
Also I am using a esql parse funtion for this, i have tried varying the CCSID and ENCODING for this but no use. ( Currently using CCSID : 500 ENCODING 785)
need few suggestions please .. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 06, 2013 4:06 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Let's start off by saying that it has nothing to do with the fact that certain fields are of integer type or not.
It has everything to do with how the message definition is created.
You have created the message definition in such a way that it either deems the message complete when it reads the first integer field, or that it then fails to match further fields after the first integer field and generates an error. |
|
Back to top |
|
 |
cociu_2012 |
Posted: Wed Feb 06, 2013 4:31 am Post subject: Re: Optional Field Parsing error |
|
|
Acolyte
Joined: 06 Jan 2012 Posts: 72
|
Veera B wrote: |
but if i dont give input data for Integer fields the parsing will stop at that point and further elements are not processed, even though it is optional field.
|
Just a thougth, have you tried validating your message against its definision?
I’m quite sure it will fail using other validating tools. If not, you probably need to check your message set. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Feb 06, 2013 5:32 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please state which version of WMB you are using.
Please state which type of physical format your message set is using ( CWF / TDS )
Please give an example of a working message and a failing message.
Finally, please quote the error message that you are receiving. For bonus points, post the output of a debug-level user trace. |
|
Back to top |
|
 |
Veera B |
Posted: Wed Feb 06, 2013 5:43 pm Post subject: |
|
|
Voyager
Joined: 16 Jan 2013 Posts: 76
|
mqjeff wrote: |
Let's start off by saying that it has nothing to do with the fact that certain fields are of integer type or not.
It has everything to do with how the message definition is created.
You have created the message definition in such a way that it either deems the message complete when it reads the first integer field, or that it then fails to match further fields after the first integer field and generates an error. |
ok. I have created all elements as global elements and then added the elements as reference to complex types, then added these complex types to Global Message element.
I need all message field data to be optional, for flexibility of input msg. how to achieve that ...
cociu_2012 wrote: |
Just a thougth, have you tried validating your message against its definision? |
would you please consider explaining how to do that, or give the link for research.
kimbert wrote: |
Finally, please quote the error message that you are receiving. For bonus points, post the output of a debug-level user trace. |
I am not getting any error while parsing ( using esql Parse function), but the elements after the blank input field do not get parsed or populated , i get error later because of missing fields.
Using MB 6.1, physical format CWF, working message has input data for all fields, but the not working message has blank(spaces) data for one integer field in the middle after which further fields don't populate.
I am posting the error from User Trace.
ConversionException BIP5505E: A data conversion failed because the data was invalid.
Type of data being read: 'decimal'
Data: ' '
Data conversion when reading or writing a message failed because the input data was invalid for the output data type. |
|
Back to top |
|
 |
cociu_2012 |
Posted: Wed Feb 06, 2013 11:54 pm Post subject: |
|
|
Acolyte
Joined: 06 Jan 2012 Posts: 72
|
Veera B wrote: |
Using MB 6.1, physical format CWF, working message has input data for all fields, but the not working message has blank(spaces) data for one integer field in the middle after which further fields don't populate.
I am posting the error from User Trace.
ConversionException BIP5505E: A data conversion failed because the data was invalid.
Type of data being read: 'decimal'
Data: ' '
Data conversion when reading or writing a message failed because the input data was invalid for the output data type. |
Is "white space (blank)" a valid value for an integer? If you define an element as integer - optional (with no xsi- nillable attribute) it must have an integer value or it must miss from the input.
An XML example:
Invalid:
Code: |
<structure>
<string_element>data</string_element>
<string_element1></string_element1>
<integer_element>0</integer_element>
<integer_element1></integer_element1>
<integer_element2>0</integer_element2>
<string_element2>data1</string_element2>
</structure>
|
Valid:
Code: |
<structure>
<string_element>data</string_element>
<string_element1></string_element1>
<integer_element>0</integer_element>
--integer_element1 is missing!
<integer_element2>0</integer_element2>
<string_element2>data1</string_element2>
</structure>
|
I hope it will help. |
|
Back to top |
|
 |
Veera B |
Posted: Thu Feb 07, 2013 1:15 am Post subject: |
|
|
Voyager
Joined: 16 Jan 2013 Posts: 76
|
cociu_2012 wrote: |
Is "white space (blank)" a valid value for an integer? If you define an element as integer - optional (with no xsi- nillable attribute) it must have an integer value or it must miss from the input. |
Thank you very much .. my understanding is a lot better now ..
Also, I was giving white spaces for integer field with padding character defined as '0' , if i change that padding chars to SPACE, It's working |
|
Back to top |
|
 |
|