Need to reject only junk values

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What are you considering "junk" or "special" characters? You probably just have a characterset issue.
-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 »

Do you have authority from the data owner arbitrarily to delete some of the characters in their data? (There are no "junk" characters.)

If the data owner needs to have particular characters removed, the "double Convert()" technique is recommended. Otherwise you have to work out how to process 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.
m_mani87
Participant
Posts: 45
Joined: Thu May 24, 2012 11:13 pm
Location: Coimbatore

Re: Need to reject only junk values

Post by m_mani87 »

open the file in vi editor,then type

:%s/^M//g

(To enter ^M, type CTRL+V, then CTRL+M)

This will remove the junk control M characters if it is present.
Then you can process the data in datastage
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Where did the question mention Ctrl-M? :?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please post the result of the AlNum() function on each of your five use cases?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

OK, here's how I would go about this provided I had my customer's imprimatur. Create a stage variable containing the characters you want to keep. Use the "double Convert" technique to remove all the others.

Code: Select all

Convert(Convert(svKeepChars, "", InLink.TheString), "", InLink.TheString)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sathyak098
Participant
Posts: 23
Joined: Tue May 14, 2013 6:34 am

Post by sathyak098 »

Thanks Ray.
It worked. Double convert is the perfect technique. hence marking as resolved
Post Reply