Convert String to Integer without using OCONV & ICONV

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
mac4rfree85
Participant
Posts: 126
Joined: Thu Jul 01, 2010 11:39 pm

Convert String to Integer without using OCONV & ICONV

Post by mac4rfree85 »

Hi Guys,

I want to convert a String Field to Decimal. But my project guidelines are not allowed to use OCONV & ICONV functions..

I tried using Seq function but it converts it to Numeric code value instead of Numeric value..

can somebody help me in this..

Cheers!!!!
Mac4rfree
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Two alternatives, off the top of my head.

1. Just do nothing. There are no data types in server jobs anyway.

2. Add zero to it (or perform any other arithmetic operation such as multiplying or dividing by 1). That will also remove leading and trailing non-significant zeroes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mac4rfree85
Participant
Posts: 126
Joined: Thu Jul 01, 2010 11:39 pm

Post by mac4rfree85 »

Ya Ray,, there was no need to transform it like in the case of Parallel..

It worked out for me.. :)
Mac4rfree
Post Reply