Problem with FTP: Char columns getting padded with zeros

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
slavik0329
Participant
Posts: 11
Joined: Tue Jan 10, 2006 2:33 pm

Problem with FTP: Char columns getting padded with zeros

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

Post 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?
slavik0329
Participant
Posts: 11
Joined: Tue Jan 10, 2006 2:33 pm

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

Post 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.
slavik0329
Participant
Posts: 11
Joined: Tue Jan 10, 2006 2:33 pm

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