Page 1 of 1

Problem with FTP: Char columns getting padded with zeros

Posted: Tue Feb 14, 2006 11:48 am
by slavik0329
I am trying to FTP a sequential file and the columns that use CHAR and Timestamp are getting padded with zeros. There rows are supposed to be tab delimeted BTW.

Original rows:

114 2006-02-01 00.00.00.000000 742 7565 74207469 226577044.42 158357477.37

114 2006-02-01 00.00.00.000000 862 4653 27876492 22677423.15 21938396.31

114 2006-02-01 00.00.00.000000 5TX 1003 5TX10042 10945067.28 10932980.64

Output:

114 02006-02-01 00.00.00.0000000 07420 075650 0742074690 226577044.42 158357477.37
114 02006-02-01 00.00.00.0000000 08620 046530 0278764920 22677423.15 21938396.31
114 02006-02-01 00.00.00.0000000 05TX0 010030 05TX100420 10945067.28 10932980.64

Posted: Tue Feb 14, 2006 11:57 am
by ArndW
How do you know that the padding is done in the FTP stage? Normally I would never expect a CHAR field to be automatically padded with leading zeroes so my first guess is that this is happening on your output. If you use a FTP stage and either write straight to a non-delimited, fixed width, no terminator sequential file; or you use the debugger in the Designer to step through execution do you already see padding?

Posted: Tue Feb 14, 2006 12:01 pm
by slavik0329
ArndW wrote:How do you know that the padding is done in the FTP stage? Normally I would never expect a CHAR field to be automatically padded with leading zeroes so my first guess is that this is happening on your output. If you use a FTP stage and either write straight to a non-delimited, fixed width, no terminator sequential file; or you use the debugger in the Designer to step through execution do you already see padding?
I use TAB delimited 009 and 000 for quotes for sequential and FTP stage. The sequential files are fine before they go through the FTP stage.

Posted: Tue Feb 14, 2006 12:13 pm
by ArndW
Try using the debugger and stepping through the values on the output side of the FTP to see if you really have leading zeroes prepended to char fields at that point. Also, it looks like a "0" is put before and after the values - could it be the column separator; perhaps you could try using " as a quote in your job just as a test to see what might change in your output.

Posted: Tue Feb 14, 2006 12:19 pm
by slavik0329
ArndW wrote:Try using the debugger and stepping through the values on the output side of the FTP to see if you really have leading zeroes prepended to char fields at that point. Also, it looks like a "0" is put before and after the values - could it be the column separator; perhaps you could try using " as a quote in your job just as a test to see what might change in your output.
I tried using a blank in the quote character field for the ftp stage instead of the 000, that worked! Thanks for your help

-Steve