Decimal to String (TD to XML file)

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
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Decimal to String (TD to XML file)

Post by vinaymanchinila »

Hi,

Converting a decimal to string (reading from teradata source, writing to XML file),

TgtCol:String[10]=string_from_decimal[fix_zero](SrcCol)

SrcCol = 2.56


The result os ' 000002.56' is there a way to avoid the leading space and have a 0 instead?


Thanks,
Thanks,
Vinay
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The string_from_decimal doesn't have an option to suppress the sign character so you will always get it and need to remove it. A modify stage can't use embedded functions, but you could put another modify stage with a trim() to get rid of the leading spaces or just a substring function to get rid of the first char or a replace function to replace the leading space with a "+" sign or "0".
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi ArndW, I used the replace function and I was wondering if we could have handled it in the StringfromDecimal function, thanks for the information.
Thanks,
Vinay
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea:
It is my belief (originally suggested by an Ascential technical person) that two consecutive Modify stages are slightly less efficient than a single Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ray - I'll keep that in mind; I've never experimented with the PX transform speed, I think that the long copmile times led me to believe it would also execute slowly :)
Post Reply