ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » error parsing integer with TDS parser

Post new topic  Reply to topic
 error parsing integer with TDS parser « View previous topic :: View next topic » 
Author Message
cynik
PostPosted: Tue Jan 19, 2010 1:41 am    Post subject: error parsing integer with TDS parser Reply with quote

Newbie

Joined: 31 Mar 2009
Posts: 9

I am parsing simple message using Message Broker TDS parser - fixed length elements.

Message content is like this: "LH 400"

- first element ("LH") - Type xsd:string, Length 2 Characters
- seccond element (" 400") - Type xsd:int, Length 5 Characters, Right Justify, Padding Character set to SPACE.

Parser is not able to remove padding spaces of seccond element and convert 400 to integer, but I don't understand why? Is it neccesary to change some settings? If I set the seccond element as type string, everything works fine..

Here is the trace:

<ParserException timestamp="2010-01-19 08:46:12.629011" thread="53" function="NXDWorker::parseNext" type="" name="" label="" text="'TDS General Error'" catalog="BIPv610" number="5421" file="/build/S610_P/src/cpi/pwf/nxd/nxdworker.cpp" line="462">
<Insert type="string">'lido.out.uplink'</Insert>
<Insert type="string">'/lido.out.uplink/FlightNumber'</Insert>
<Insert type="integer">21</Insert>
<Insert type="string" />
</ParserException>
<ConversionException timestamp="2010-01-19 08:46:12.629036" thread="53" function="DataCnv::StrToInt64" type="" name="" label="" text="'CPI Converter Input Data Invalid'" catalog="BIPv610" number="5505" file="/build/S610_P/src/cpi/bsutils/datacnv.cpp" line="614">
<Insert type="string">'string'</Insert>
<Insert type="string">' 400'</Insert>
<Insert type="string" />
</ConversionException>

Please help
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jan 19, 2010 3:13 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

This should work OK.
The only problem I can see is that '0400' is 4 characters, and you have set the length to 5 characters. But the error message is reporting '0400', so maybe that was a typing error in your post.
Back to top
View user's profile Send private message
SOLOHERO
PostPosted: Wed Jan 20, 2010 7:30 pm    Post subject: Reply with quote

Centurion

Joined: 01 Feb 2007
Posts: 107

There lies your problem.

Message content is like this: "LH 400"

- first element ("LH") - Type xsd:string, Length 2 Characters
- seccond element (" 400") - Type xsd:int, Length 5 Characters, Right Justify, Padding Character set to SPACE

Integer cant be space it should be zero.
insted of giving space fill with a zero like ( LH0400)..and this should work.

Hope this helps
_________________
Thanks
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Jan 21, 2010 1:05 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Integer cant be space it should be zero.
insted of giving space fill with a zero like ( LH0400)..and this should work.
Two points:
- the spaces are not part of the integer value. They are padding.
- cynik probably cannot change the input message anyway

It's fine to pad an integer with spaces, and I'm 99% certain that TDS supports it. Keep looking!
Back to top
View user's profile Send private message
farbman
PostPosted: Wed Sep 22, 2010 6:45 am    Post subject: Reply with quote

Newbie

Joined: 19 Sep 2008
Posts: 8

I have the same problem (wmb 6.1.0.6).
Can't parse space padded elements as int or decimal with TDS.

A data conversion failed because the data was invalid.
Type of data being read: 'string'
Data: ' 10'

Guess my solution will be to read them as strings and convert it in a compute node.
Back to top
View user's profile Send private message
farbman
PostPosted: Mon Oct 04, 2010 5:21 am    Post subject: Reply with quote

Newbie

Joined: 19 Sep 2008
Posts: 8

Found a setting for this in the message set.

Under Character data settings there is a box called Fixed length string.
Select Trim Paddring Chars in the dropdown box and as long as you have put space as padding character in the element it should work.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » error parsing integer with TDS parser
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.