Striping Line Feed Character

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
Puli
Participant
Posts: 53
Joined: Mon May 26, 2008 2:59 am
Location: Australia

Striping Line Feed Character

Post by Puli »

Hi

We have Datastage server Edition in Windows PF and DB2 as Source system. In my data I have a junk field or (LineFeed character) along with data. i have tried with Trim and Ereplace functions but its not identifying the junk field in the data.
The data looks like.............
Lack of Experience Domain/Technology/Product
How do i trim that unwanted field " " from my data....

Thanks in advance for ur valuable comments
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

EReplace must have worked in this case.

What did you try ?

Try using Convert().
mk_ds09
Participant
Posts: 72
Joined: Sun Jan 25, 2009 4:50 pm
Location: Pune

Post by mk_ds09 »

If data is like the example you have given..means if the junk character is in between, trim wont work in that case.

If you can view your inputs in unix, you can replace those junk characters..

Hope this helps !
-----------------------------------
Regards
MK

What would you attempt to do if you knew you could not fail?

-----------------------------------
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

what about trim with 'A' option.

are you sure its a line feed character?
try to put the data in any hex editor to identify the character.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First you must identify the character, then you can strip it easily. A hex editor is the easiest way to do that and there are a ton of free ones out there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sandeepsreedhar
Participant
Posts: 15
Joined: Mon Dec 21, 2009 12:49 am
Location: India

Post by sandeepsreedhar »

How to handle if we are not sure about the incoming junk character?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Become sure! Your initial post told us it was Line Feed.

(This may well be valid data. You can not unilaterally change the data. You may need to handle these charaters rather than simply eliminating them.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Abhijeet1980
Participant
Posts: 81
Joined: Tue Aug 15, 2006 8:31 am
Location: Zürich
Contact:

Post by Abhijeet1980 »

Puli,

You never explained the reason for removing the so-called junk character. Reason for having it, either.

Theres no need to remove any such characters unless it is displayed somewhere in reports. I believe, this is some kinda descriptive field.

If the above is true, purpose of ETL tool is "Data mover".

If the above is false, get in touch with DB2 DBA on why control characters are included within a field.


Coming to your problem, line feed (Newline or end-of-line aka EOL) and carriage return (CR), try to get the exact character you need to remove for that you feel junk.

Many regards,
Abhijit
Kind regards
Abhijit Gaikwad
Post Reply