stringsplitdelimiterdatastage

Split string and add to three columns in datastage


I have a column called Name which has the following string:

F.M. Brown's Tropical Carnival Small Hookbill, 5-Pound
Kaytee Forti Diet Egg-Cite Food for Parakeets, 5-Pound Bag

I wan't to split the string using "," and then by "-" and have it in three columns called Product, Brand & Description. I couldn't find any string split functions that can be used for this. How can I split the string and add them to columns?


Solution

  • Field(%string%,%delimiter%,%occurrence%,[%number%])

    DataStage Reference

    You should make multiple Stage variables: Product, Brand and Description.

    Example:

       Product SV: Field (DSLink.Name, “,”, 1, 1)
       Brand   SV: Field (DSLink.Name, “-”, 2, 1)
       Descrip SV: Field (DSLink.Name, “,”, 3, 1)