sqletldatastageibm-infosphere

get substring before a given character in datastage transformation


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

Solution

  • Simple Field() functions should do it.

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