How to remove control M or special character by ds jobs

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mayura
Participant
Posts: 40
Joined: Fri Aug 01, 2008 5:58 am
Location: Mumbai

How to remove control M or special character by ds jobs

Post by mayura »

Hi,

We can remove the control m or special characters in UNIX scripts.. but
is there any way to remove the special characters coming in flat files from Datastage jobs?
:roll:
Mayura
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, there are various ways and which method is used depends upon how you read the files. Are the Control-M characters in strings in the job? If yes, then a simple Convert(Char(13),'',In.ColumnName) will do the trick.
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Post by sagar deshmukh »

You can use Tr command to remove control M character... in the before job subroutine....

You have to design your job accordingly
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

If ^M is at the end of the record, it may be due to DOS type record termination. Setting this property will handle it properly.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sainath.Srinivasan wrote:If ^M is at the end of the record, it may be due to DOS type record termination. Setting this property will handle it properly.
This, typically. But as Arnd noted there are various ways so it really depends on the where and the what of it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I expect you will end up setting the Record Delimiter String property to "DOS style".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

FTP will also get rid of these if you transfer ascii instead of binary.
Mamu Kim
mayura
Participant
Posts: 40
Joined: Fri Aug 01, 2008 5:58 am
Location: Mumbai

Post by mayura »

kduke wrote:FTP will also get rid of these if you transfer ascii instead of binary. ...
ok will try this and let u all know...

between thanks.. but keep posting new ideas for the same :lol:
Mayura
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Looks like plenty of ideas here already, you need to go implement now and let us know how things turn out. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply