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 IndexWebSphere Message Broker SupportJSON integer value converted to scientific notation

Post new topicReply to topic Goto page Previous  1, 2
JSON integer value converted to scientific notation View previous topic :: View next topic
Author Message
rekarm01
PostPosted: Sun Nov 05, 2017 2:42 pm Post subject: Re: JSON integer value converted to scientific notation Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1262

souciance wrote:
rekarm01 wrote:
Use Trace nodes to confirm where the data types of the relevant input and output fields might be changing from INTEGER to FLOAT, ..., looking more closely at the code that creates the output fields ....

So, ... how's that going? What did the Trace nodes reveal about the data types of the input and output fields? If, for example, either the input field or the output field were a FLOAT, then that would explain why the output message would format the output value using exponential notation. Any program that assigns an INTEGER value to a FLOAT variable is going to convert the value, regardless of any "decimal points, or anything like that". The next question would then be why the message flow had created the input or output field as a FLOAT.

souciance wrote:
Well if it isn't the JSON parser, then what could it be?

You tell us. So far, aside from a possibly unnecessary call to FIELDVALUE() in a "generic loop", you have not provided any information about how the message flow copies data from an input field to an output field, certainly not enough for anyone else to reproduce the problem. Does the message flow use ESQL SET statements, CREATE statements, Mapping nodes, other non-ESQL nodes, or something else? Are there any JSON schemas or Swagger documents involved?

souciance wrote:
The user trace showed the data to be an integer when the JSON parser first receives the message.

Since the problem seems to occur after that point, that might be a better place to look.

souciance wrote:
There should therefor be no need to change the format after a FIELDVALUE.

The message flow stores INTEGER or FLOAT values internally using a binary format. The JSON parser needs to change the format when converting numeric data from text to binary while parsing the input, and again when converting from binary to text while serializing the output. Whether the final output format matches the initial input format depends on the message flow.
Back to top
View user's profile Send private message
souciance
PostPosted: Sun Nov 05, 2017 11:42 pm Post subject: Re: JSON integer value converted to scientific notation Reply with quote

Acolyte

Joined: 29 Jun 2010
Posts: 69

rekarm01 wrote:
souciance wrote:
rekarm01 wrote:
Use Trace nodes to confirm where the data types of the relevant input and output fields might be changing from INTEGER to FLOAT, ..., looking more closely at the code that creates the output fields ....

So, ... how's that going? What did the Trace nodes reveal about the data types of the input and output fields? If, for example, either the input field or the output field were a FLOAT, then that would explain why the output message would format the output value using exponential notation. Any program that assigns an INTEGER value to a FLOAT variable is going to convert the value, regardless of any "decimal points, or anything like that". The next question would then be why the message flow had created the input or output field as a FLOAT.

souciance wrote:
Well if it isn't the JSON parser, then what could it be?

You tell us. So far, aside from a possibly unnecessary call to FIELDVALUE() in a "generic loop", you have not provided any information about how the message flow copies data from an input field to an output field, certainly not enough for anyone else to reproduce the problem. Does the message flow use ESQL SET statements, CREATE statements, Mapping nodes, other non-ESQL nodes, or something else? Are there any JSON schemas or Swagger documents involved?

souciance wrote:
The user trace showed the data to be an integer when the JSON parser first receives the message.

Since the problem seems to occur after that point, that might be a better place to look.

souciance wrote:
There should therefor be no need to change the format after a FIELDVALUE.

The message flow stores INTEGER or FLOAT values internally using a binary format. The JSON parser needs to change the format when converting numeric data from text to binary while parsing the input, and again when converting from binary to text while serializing the output. Whether the final output format matches the initial input format depends on the message flow.


I'll provide more details on this shortly.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum IndexWebSphere Message Broker SupportJSON integer value converted to scientific notation
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.