Page 1 of 1

Problem with left justification

Posted: Tue Apr 11, 2006 8:06 pm
by somu_june
Hi,

Iam giving in transformer Derivation as If (isnull(docnum)) then 0000000001 else docnum . Iam loading to a seq file and DB2 table but when Iam loading Iam getting as 1 instead of 0000000001 the left side zeros are deleted . Please help me how to achieve 0000000001 instead of 1.




Thanks,
Somaraju

Posted: Tue Apr 11, 2006 8:16 pm
by ray.wurlod
If the column definition on the DB2 table is some kind of integer, the leading zeroes are redundant and therefore not stored.
If the column definition specifies Char, then leading zeroes can be kept.

Posted: Tue Apr 11, 2006 9:00 pm
by somu_june
Hi Ray,

The columm definition is char and I want to load in both sql file and DB2 table .Plz tell me how to achieve it






Thanks,
Somaraju.

Posted: Wed Apr 12, 2006 12:36 am
by ArndW
What is the definition in the DB/2 Table for this column? If it is also char(10) then try using "0000000001" with quotes.

Posted: Wed Apr 12, 2006 1:55 am
by kondeti
Hi

Exactly when ever you loading data first in sequentialfilestage/fileset then DB2 we need to do the below thing for char/Varchar Datatypes

you need to use the hardcode thing in " "(Double Code) in the Derivation part


Regards
Shiva Kondeti

Posted: Wed Apr 12, 2006 7:54 am
by kumar_s
What is the value for docnum. By any chance is docnum is equal to 1?
Are you doing any type conversion after the transformer?
What is the datatype of the field in the transformer which holds the value?

Posted: Wed Apr 12, 2006 9:52 am
by somu_june
Hi Kumar,

Iam not doing any type conversion my problem was solved by giving the value inside the quotes .


Thanks a lot for all the posters who solved my problem





Thanks,
Somaraju