Page 1 of 1

FTP Leading Zeros

Posted: Fri Sep 04, 2015 11:17 am
by MrBlack
I'm using the FTP_Enterprise stage for SFTP for the first time. When my numeric columns are being sent through, the recipient is seeing leading zeros on the numbers. So the column was define Numeric 38 and my data is showing up as

Code: Select all

00000000000000000000000000000000054321
How would I remove these leading zeros from the CVS so my recipient doesn't have to?

Posted: Fri Sep 04, 2015 6:33 pm
by qt_ky
It is likely related to the data type chosen rather than the FTP stage or type of transfer. Replace the FTP stage with Sequential File stage to see. Then do a search on "remove leading zero" which is a topic that has been resolved online here many times over. Resolve it prior to FTP.

Posted: Fri Sep 04, 2015 11:20 pm
by ray.wurlod
That's how DataStage works, and always has. It adds leading and trailing nonsignificant zeroes to the extent specified by the Precision and Scale settings. Don't worry, it's still the same number and will produce the same results in arithmetic.

You can only remove the zeroes if the target data type is string of some kind.

Posted: Mon Sep 07, 2015 2:59 am
by ArndW
As Ray has hinted at, but not explicitly stated, convert your numeric value into a string inside DataStage before writing to the CSV file, and your leading zeroes will not appear.

Posted: Thu Oct 15, 2015 2:48 am
by arunkumarmm
Anyway its a csv file. Why cant you define your metadata as varchar? Thats should solve your problem I guess.

Re: FTP Leading Zeros

Posted: Fri Oct 16, 2015 1:58 am
by naveenkumar.ssn
hi

Cant we add a transformer and trim the leading "zeros".

Regards
Naveen

Posted: Sun Oct 18, 2015 4:03 pm
by ray.wurlod
Not if the data type is Decimal.

Well... you can, but DataStage will reinstate them.