CR/LF Scrubing

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
SWW
Participant
Posts: 29
Joined: Thu Nov 11, 2004 12:51 pm
Location: Louisville

CR/LF Scrubing

Post by SWW »

Hi,

I am trying to create a routine that will scrub carriage returns and line feeds from the end of a field in the transform stage while the job is processing. This happens on our customer data when individuals cut and paste their address and leave a trailing CR/LF. My file layout is fixed and when this issue is incountered, the job aborts. To manually fix, I open the file in ultra edit and place cursor on corresponding line, backspace, hit the space bar twice to reposition the remaining fields of the record.

Is there any other way to rid CR/LF from a record?

Any help would be great.

Thanks, Steve
SWKYDERBY
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You can set the column attributes on fixed-length input files to have "contains delimiters" and then use a derivation along the lines of "CONVERT(CHAR(10):CHAR(13),'',In.ColumnName)" to strip out the unwanted <cr> and <lf> characters.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
As this post was made on the FAQ Discussion Forum Arnd assumed that this is related to a server job.
Please update the related details.
Also if this job is a Parallel job please note it so I can move it to the appropriate forum.

P.S.
Searching will find other routines that can do this task as well, but Arnd's solution is as good as any other you might find.

Good Luck,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply