Decimal to String conversion in modify stage

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
ramsubbiah
Participant
Posts: 40
Joined: Tue Nov 11, 2008 5:49 am

Re: Decimal to String conversion in modify stage

Post by ramsubbiah »

can you tell what is your input decimal field length?
Knowledge is Fair,execution is matter!
kalpanam
Participant
Posts: 39
Joined: Sat Apr 19, 2008 6:14 am

Re: Decimal to String conversion in modify stage

Post by kalpanam »

INTERNET_ORDER_NBR:decimal(9,0)
Kalpana Marupudi
ramsubbiah
Participant
Posts: 40
Joined: Tue Nov 11, 2008 5:49 am

Re: Decimal to String conversion in modify stage

Post by ramsubbiah »

i am getting the exact output as what you required, find my specification for conversion

UPC:string[20] = string_from_decimal [suppress_zero](UPC)

and the output is

Peek_24,0: UPC:49049716

check your column definition in the output tab of modify stage, and before modify stage also, am not sure why you are not getting exact result
Knowledge is Fair,execution is matter!
kalpanam
Participant
Posts: 39
Joined: Sat Apr 19, 2008 6:14 am

Re: Decimal to String conversion in modify stage

Post by kalpanam »

Yes,Thanks for your timely response and now i'm getting the exact required output.
Kalpana Marupudi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

string[20] is Char(20) - DataStage will right pad. If you use string[max=20] (which is VarChar(20)) the trailing pad characters will not be applied. You will always get leading and trailing non-significant zeroes that indicate the full precision and scale of the decimal number - you can remove these using string_trim() function, but probably not in the one Modify stage expression.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ramsubbiah
Participant
Posts: 40
Joined: Tue Nov 11, 2008 5:49 am

Post by ramsubbiah »

Hi Ray,

Thanks for your valuable tip, i will check on this in my job!
Knowledge is Fair,execution is matter!
Post Reply