Left function

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

Left function

Post by somu_june »

Hi,

I have a requirement like this . I have a field1 and field2 with decimal(7,4) in DB2 table for example if have a value of field1 as 001.2000 and 001.4000. I need output as 1.20001.4000 and I am using in transformer left (field1,eight):left(field2,eight) but iam getting output as 001.200 001.400 how to eliminate the zeros before numeric values and how toget the other Zero after decimal the output I want is Char .

THe final output must be 1.2000 1.4000


Thanks,
Somaraju.
somaraju
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Convert the numeric values to VarChar then do a trim to remove leading 0's and then perform your concatenation. Look up the trim() function declaration in the PX manual, I think it is trim(In.Column,"0","F") but I'm not certain and don't have access to the manual here.
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 Arnd,


Thanks for reply. My problem was solved Iam using right(trim(DecimalToString(field1,"fix_Zero")),6) : right (trim(DecimalToString(field2,"fix_Zero")),6).


Thanks,
Somaraju.
somaraju
Post Reply