DecimalToString warning in job

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
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

DecimalToString warning in job

Post by kd813 »

While using the following command :
DecimalToString(lReadInput.NRx1,"fix_zero,suppress_zero")

I m getting the following warning:
"Transformer_0,0: Conversion error converting input field NRx1 to output field NRx1, data may have been lost"

My input datatype is decimal(9,3) and output datatype is varchar(9)
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Try giving output datatype to varchar(11)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea: It would be a better learning experience were you to explain why.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

ray.wurlod wrote::idea: It would be a better learning experience were you to explain why.
Sure.

9 + 1(Sign) + 1(Decimal Point)= Varchar(11)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Well done.

In words, the string needs nine characters for the nine significant digits (precision of the Decimal data type), plus one for the sign and one for the decimal point character. That's a total of eleven characters. The VarChar needs to be at least this large.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

A golden star awaits :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply