How to eliminate leading zero's in Decimal type column value

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
Sridhar Sivakoti
Participant
Posts: 35
Joined: Tue Feb 13, 2007 5:30 am

How to eliminate leading zero's in Decimal type column value

Post by Sridhar Sivakoti »

Hi,

My requirement is to find the length of the Decimal datatype column which is coming from source(Sequential file).

When I am trying to find the length of this column I am not getting the actual legths, I am getting the datatype length.

Example: ABC column, declared as Decimal(15). Value is 103.

I am getting the length as 17 instead of 3. I think it's considering leading zero's and decimal.

How can I get the length as 3.

Here I can not change the datatype from decimal to integer.

How can I eliminate the leading zero's, Is there any function in Transformer?

Please help on this issue.

Thanks
carmenh
Participant
Posts: 2
Joined: Tue Oct 16, 2007 2:48 am

Re: How to eliminate leading zero's in Decimal type column v

Post by carmenh »

DecimalToString(JOIN_OK.IMSI_BSCS,"suppress_zero")
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can use the AS_INTEGER() function and then take the length of that.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Sridhar Sivakoti
Participant
Posts: 35
Joined: Tue Feb 13, 2007 5:30 am

Post by Sridhar Sivakoti »

DSguru2B wrote:You can use the AS_INTEGER() function and then take the length of that.
Thanks DSguru2B.
Post Reply