functions

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
veera24
Premium Member
Premium Member
Posts: 150
Joined: Thu Feb 07, 2008 9:37 pm
Location: NewYork

functions

Post by veera24 »

Am having both decimal and whole numbers in my list. If the input is decimal then i need to change into a whole number or else i shud retain the input.
For example if the input is 0.1 then the o/p shud be 10 and if the input is 5 then o/p shud be the same 5.

Thanks in advance
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

With what logic are you converting 0.1 to 10, are you multiplying with 100?
What do you expect when the input is 0.01?
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Moderator: please move to server forum
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
veera24
Premium Member
Premium Member
Posts: 150
Joined: Thu Feb 07, 2008 9:37 pm
Location: NewYork

Post by veera24 »

Minhajuddin wrote:With what logic are you converting 0.1 to 10, are you multiplying with 100?
What do you expect when the input is 0.01?
Actually the column consists of both kinda data i mean decimal as well as whole number.
Am in need to convert the decimal value by multiplying with 100. Because we are treating the decimal data as a percentage value.

Thanks..
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

Two options:

1. Check if the first char is 0, if yes then multiply by 100 else pass the input value. eg If left(input.col,1)=0 then input.col*100 else input.col
2. Check if the input value has a decimal (.) in it, if so multiple by 100 or pass the input value eg If index(input.col,'.')<>0 then input.col*100 else input.col
Post Reply