Problem with left justification

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
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Problem with left justification

Post 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
somaraju
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post 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.
somaraju
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Post 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
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post 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
somaraju
Post Reply