Datastage - Transformer - String Functions - Examples


Transformer – String functions

Convert

Input.ColA = ‘Tom - Mark’

Convert(“-",“:", Input.ColA)
‘Tom : Mark’

Field

Input.ColA = "chocolate, ice cream, candy”

Field(Input.ColA,",",2)
ice cream

Field(Input.ColA,",",2,2)
ice cream, candy

Index

"chocolate, chocolate ice cream, candy" 

Index(Input.ColA,"chocolate",2)
12

Left
"chocolate, chocolate ice cream, candy" 

Left(Input.ColA,9)
chocolate

Len
"chocolate“

Len(Input.ColA)
9


Num

"22“

Num(Input.ColA)
1

"twenty two",
0

PadString
 
"ABC1" 

PadString(Input.ColA,"0",5)
"ABC100000"

Right

"chocolate, chocolate ice cream, candy" 

Right(Input.ColA,5)
“candy”

Space

100

Space(Input.ColA)
100 space characters

Str
 
"choc“

Str(Input.ColA,5)
"chocchocchocchocchoc"






Post a Comment

Previous Post Next Post

Contact Form