convert from decimal to string

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
rockunder78
Participant
Posts: 8
Joined: Mon Jun 18, 2007 11:08 pm
Location: chennai

convert from decimal to string

Post by rockunder78 »

how to use type conversion function? wht will be the syntax
decimal to string:DecimalToString(%number%,[%"[fix_zero][,suppress_zero]"%])
10.22 to convert into 1022
vkhandel
Participant
Posts: 35
Joined: Wed Oct 04, 2006 12:12 am
Location: Pune

Re: convert from decimal to string

Post by vkhandel »

You can achieve the result by using the following stage variables -
decimaltostring(<column_name>,"suppress_zero") ............. SVar1
Index(SVar1, ".",1) ............. SVar2
Len(SVar1) - SVar2 ............ SVar3

And then writing the following derivation -
SVar1[1,(SVar2- 1)] : SVar1[(SVar2+ 1),SVar3]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Multiply by 100?
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