Decimal representation as Double datatype in xml stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Decimal representation as Double datatype in xml stage

Post by basu.ds »

Hi ,
I have a source field as decimal data type value is 899.00 but in xml stage datatype is double and value represented in xml as 899 my client expecting as 899.00 with double datatype Is this possible with out changing double data tyepe in xml ? please advise
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

Double datatype is a floating-point numeric datatype. It will show as many decimal digits as needed.

In an xsd-definition the only way to get a fixed format for numeric values is to set the result-datatype to string.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

are you using the XML Stage or the xmlOutput Stage?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

xml input stage
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Then treat the data as character, which is what it is. Don't let the software do any kind of interpretation for you. Take 100% control. Make all of your columns char or varchar, pull out the pure strings from the xml tags......

...focus on the "parsing", and get the strings "as they are" in the document.....and then downstream, if you need more zeros, add them....or take them away.........if you need to do conversions and then formally "import" it into the framework and turn it into a real double if this is EE, then do that in a transformer or other stage using your favorite technique.

With xmlInput, focus on the parsing.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply