get substring before a given character in datastage transformation

1k views Asked by At

i need to extract string with (-) as delimeter. Below is the example

INPUT
COL_1 : 12345-678-910


OUTPUT:
col1 = 12345
col2 = 678
col3 = 910
1

There are 1 answers

0
Ray Wurlod On BEST ANSWER

Simple Field() functions should do it.

col1 <--  Field(InLink.TheString, "-", 1, 1)
col2 <--  Field(InLink.TheString, "-", 2, 1)
col3 <--  Field(InLink.TheString, "-", 3, 1)