translate a string into a number

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
acool
Participant
Posts: 29
Joined: Tue Feb 17, 2004 4:31 pm

translate a string into a number

Post by acool »

Hi everyone,

I need to convert a varchar into a numeric.
the varchar looks like this +xxxxx.xx , where x represents anumber.
for example, +00000.00, +00106.98, +00020.55

can anyone give me some ideas?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Because there are no data types within DataStage (OK, that's a simplification, but it's how things seem), you can actually do nothing.

If the sign is going to cause a problem, simply perform some arithmetic. The most efficient is adding zero.

Code: Select all

InLink.TheVarChar + 0
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply