Tuesday, January 29, 2013

Double convert in Datastage


Convert Function

Replaces every instance of specified characters in a string with substitute characters.

Syntax-Convert (list, new.list, string)
The two lists of characters correspond. The first character of new.list replaces all instances of the first character of list, the second replaces the second, and so on. If the two lists do not contain the same number of characters:
1)Any characters in list with no corresponding characters in new.list are deleted from the result. 
2)Any surplus characters in new.list are ignored.
3)We can not replace a string with string  by using convert function we have to use parallel Ereplace c++ routine

Example-How to separate alphabets and numeric values?

Input               
col             
Abc123456            
Pqrs698               

output              
col_1,col_2                 
Abc,123456
Pqrs,698

Convert(Convert('ABCDEFGHIJKLMNOPQRSTUVWXYZZ','',Upcase(Col))
,'',Col)=col_1
Convert(Convert('0123456789','',Upcase(Col)),'',Col)=col_2

Here I am using  second point as a reference

1 comment:

  1. I really enjoy the blog.Much thanks again. Really Great.
    Very informative article post. Really looking forward to read more. Will read on…


    oracle online training
    sap fico online training
    dotnet online training
    qa-qtp-software-testing-training-tutorial

    ReplyDelete