Page 1 of 1

issue with extral line feeds

Posted: Mon Nov 28, 2011 12:00 pm
by hobocamp
I've seen some replies to problems similar to this, but haven't yet been quite able to make anything work.

We have a sequential file coming from a vendor in which a particular column occasionally contains a LF character (X'0A'), even though the end of the row has not actually occurred. Of course that causes my DS job to consider the data as two rows.

I've seen suggestions of using the EReplace and Convert functions to replace it with a space, but so far nothing I've tried will get rid of it. Due to the nature of the data I am always able to recognize the location of the extra LF, but I haven't come up with a way that actually seems to replace it.

Thanks for any suggestions.

Tom

Posted: Mon Nov 28, 2011 1:03 pm
by major
hi,

Ereplace and Convert functions should work.
Can you post the syntax here and check if there are any other columns wiht extra LF.

Thanks
Major

Posted: Mon Nov 28, 2011 1:05 pm
by ray.wurlod
Scroll to the right in the Columns grid in your Sequential File stage and set the "Contains Terminators" property for the field(s) in question.

Posted: Mon Nov 28, 2011 1:49 pm
by hobocamp
Thanks for the suggestions so far.

I think I'm getting closer, but in effect, my ultimate goal is to join two rows that have been artificially broken by the presence of the wayward LF.

The file is delimited, so I use the Count function to identify the row with the extra LF. For those rows, my syntax is Convert(FromSrc.FullRow, char(10), " ").

My thought was that if I removed the LF from the input rows in question, the output target would then contain the broken records joined back together. Does it sound like I'm on the right track? I'm getting the feeling that I may be approaching this incorrectly.

Posted: Mon Nov 28, 2011 5:46 pm
by chulett
You'll first need to implement what Ray noted simply to be able to read them as a single record. After that, you can do whatever is needed to remove the LFs if you still feel the need, including the Convert() that you posted.

Posted: Tue Nov 29, 2011 12:21 pm
by hobocamp
Thanks Craig. I will give Ray's suggestion a try. I was attempting to read each row as one long string, thinking that might be a better way to deal with the extra LFs. I'll use the actual file definition with the "contains terminators" option set to 'Yes'. I'll update with my results.

Thanks again.