Leading Zeros with Numeric Type

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
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Leading Zeros with Numeric Type

Post by DS_MJ »

Hello:

Datstage ver: 8.0
Database= Oracle 10g

Source Table:
Months = Numeric Type, Length = 8
Days = Numeric Type Length = 2

The SQL:

select COL_AA_DT, COL_BB_DT, Months, Day trunc
(months_between(COL_AA_DT,COL_BB_DT )) AS months,
(trunc(COL_AA_DT)-trunc(add_months(COL_BB_DT ,trunc(months_between(COL_AA_DT,COL_BB_DT ))))) As days
from
TABLE_ABC
where (months_between(COL_AA_DT,COL_BB_DT )) > 0


The SQL creates the months and Day column.

I use this SQL in Datasge EE ver 8.0 in the Oracle Enterprise Stage. When I view the table I see the columns Months and Days with leading zeros ending with a period. EX: 00123.

I want to Trim the Leading zeros and remove the "." (period).

My target is a Dataset and the months and Days field are as follows:
Months = Numeric, Length 8
Days = Char 2

I have looked into the DSXchange but all are for Decimal to String conversion which is not applicable for me. Would appreciate if somebody could guide me with removing the leading zero's and the period with the numeric Data Type.

Thanks in advance.
MJ
Thanks in advance,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you mean you see that when you 'View Data' from the stage, then you are trying to solve a non-existent problem. They are an artifact of the viewer.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply