IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Sorting Records in WTE...

    Posted 10/07/11 10:10 AM

    Originally posted by: bchin74


    I have an input file like the following:
    2345|Ella Fong|2134
    1234|Emily Lee|4567
    9877|Christy Huang|1111

    I need to build a key which the key = field 1 + field 2 + field 3, then sort the records...
    so my output should look like this order:
    1234|Emily Lee|4567
    2345|Ella Fong|2134
    9877|Christy Huang|1111

    What would be the most efficient way to build this??

    Thanks for any feedbacks..
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: Sorting Records in WTE...

    Posted 10/11/11 04:49 AM

    Originally posted by: thorstenhirsch


    Since your keys have the very same order as the fields (field 1 + field 2 + field 3), you can just SORTUP() the whole group, assuming that your typetree is built like that.

    File (Type: Group, Contents: Row(s)
    Row (Type: Group, Contents: all Elements)
    Col1 (Type: Element)
    Col2 (Type: Element)
    Col3 (Type: Element)

    So you use File on InputCard1 and also on OutputCard1. The rule for OutputCard1 is =SORTUP(Row:InputCard1)

    But there's a little backdraw: SORTUP will treat all elements (and the delimiter!) as plain text. This might be not what you want. Consider the following case:

    234|Ella Fong|2134
    1234|Emily Lee|4567
    9877|Christy Huang|1111

    You might say, that this is already sorted since 234 < 1234. But SORTUP will treat 234 as text instead of a number, so 234 > 1234 and SORTUP will give you:

    1234|Emily Lee|4567
    234|Ella Fong|2134
    9877|Christy Huang|1111

    So far you can't just tell SORTUP to do a numerical sort. You can solve this issue by filling up the numbers (234 -> 0234), but that's not very efficient since you process all your input several times.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender