Page 1 of 1

Re: Decimal to String conversion in modify stage

Posted: Fri Sep 03, 2010 5:35 am
by ramsubbiah
can you tell what is your input decimal field length?

Re: Decimal to String conversion in modify stage

Posted: Fri Sep 03, 2010 5:43 am
by kalpanam
INTERNET_ORDER_NBR:decimal(9,0)

Re: Decimal to String conversion in modify stage

Posted: Fri Sep 03, 2010 5:58 am
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

Re: Decimal to String conversion in modify stage

Posted: Fri Sep 03, 2010 6:14 am
by kalpanam
Yes,Thanks for your timely response and now i'm getting the exact required output.

Posted: Fri Sep 03, 2010 6:19 am
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.

Posted: Fri Sep 03, 2010 6:30 am
by ramsubbiah
Hi Ray,

Thanks for your valuable tip, i will check on this in my job!