Decimal Shift

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
Diya
Participant
Posts: 38
Joined: Fri Feb 17, 2006 7:02 am

Decimal Shift

Post by Diya »

Hi,

Im trying to apply a decimal shift to the incoming data.

Incoming column is Precision=6
Scale=0

Output format needed is
Precision=6
Scale=3.

That means I want to shift the incoming number 3 places to the right.

Is there an inbuilt function/routine for this?

Or can anyone tell me how to do that?

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

Post by ray.wurlod »

Several possibilities. For example:

Code: Select all

InLink.TheColumn / 1000

Code: Select all

Fmt(InLink.TheColumn, "6R3")

Code: Select all

Oconv(InLink.TheColumn, "MD3")

Code: Select all

Left(InLink.TheColumn, Len(InLink.TheColumn)-3) : "." : Right(InLink.TheColumn, 3)

Code: Select all

Fmt(InLink.TheColumn, "R###.###")
Last edited by ray.wurlod on Thu Aug 10, 2006 4:26 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

What about

Code: Select all

Value/1000
Guessing if your data is 999999 then you want 999.999
Success consists of getting up just one more time than you fall.
Diya
Participant
Posts: 38
Joined: Fri Feb 17, 2006 7:02 am

Post by Diya »

Thanks guys....I cudn even think of such a simple logic.. :cry:
Post Reply