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
Problem with FTP: Char columns getting padded with zeros
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 11
- Joined: Tue Jan 10, 2006 2:33 pm
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?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 11
- Joined: Tue Jan 10, 2006 2:33 pm
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.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?
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.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 11
- Joined: Tue Jan 10, 2006 2:33 pm
I tried using a blank in the quote character field for the ftp stage instead of the 000, that worked! Thanks for your helpArndW 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.
-Steve