Convert function ??

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
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Convert function ??

Post by Nagac »

i know the syntax of convert() function ..But wanted to know the usage of that function ??

ex :

Input : nar(e)-sh
expected output : naresh

please tell me the exact function ?? with example??
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

This function has been extremely well-discussed within the forum.

You say that you know the syntax: Convert(fromlist,tolist,expression)
The function converts the characters listed in string fromlist to the characters listed in string tolist when found in the string expression.

Fairly straightforward:
- Do you know what characters you want to replace?
- Do you know what you want to replace them with?
- Do you know what string you want to apply this conversion to?

Plug those answers into the function template. The output is the converted string.

Remember: This is character replacement, not string replacement. If you need string replacement, use ereplace in a basic transformer, pxEReplace available here on the site or code your own function.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Did you try Convert('(e)-','',Input.Filed)
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
MarkB
Premium Member
Premium Member
Posts: 95
Joined: Fri Oct 27, 2006 9:13 am

Post by MarkB »

kumar_s wrote:Did you try Convert('(e)-','',Input.Filed) ...
I don't think that is what he wants, as that would remove the 'e'. On the other hand, Convert('()-','',"nar(e)-sh") should result in naresh.
Post Reply