string to decimal...

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
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

string to decimal...

Post by allavivek »

Hi all,,

My source is varchar(80) which is havin unsigned value .. ex: -13444.2333

My target is decimal(38,10)...

I gave

If IsNull( col) Then SetNull() Else StringToDecimal(UStringToString(TrimLeadingTrailing(col)))

iam getting all 0's instead of value....

I guess all the lenghts given are good...

Any suggestions....

Thanks...
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

Post by allavivek »

Hi

if the input was -123.334 the length should be 8 but its showing me 9....

How to get rid of this??
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For starters, this can not be an unsigned value - it has a sign! Try changing the definition such that it is not recorded as unsigned.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

Post by allavivek »

ray.wurlod wrote:For starters, this can not be an unsigned value - it has a sign! Try changing the definition such that it is not recorded as unsigned. ...
ray iam having both signed and unsigned values as input...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Therefor... signed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply