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.  Split input based on condition

    Posted 04/17/16 08:27 AM

    Originally posted by: yeswtx


    Hello all,

    We need to group the input data to get a particular output: (In a map rule)

    logic is find the end input fields value whether it falls in 1-5 or 6-0 then create an occurrence for 1-5 , then 6-0, again 1-5.....so on..

     

    Input:

    1|18|FREIGHT
    2|19|CONTRACTOR.
    3|20|7 PIECE(S)
    4|21|BSP HAMMER NO.1 
    5|22|HYDRAULIC HOSES HAMMER NO.1 
    6|23|LEADERSECTION NO.6 LEADER 2 (LEADERHEAD) 
    7|24|LEADERSECTION NO.4 LEADER 1 
    8|25|LEADERSECTION NO.5 LEADER 1 
    9|26|LEADERSECTION NO.1 LEADER 1 (LEADERFEET) 
    10|27|SUPPORTFRAME HAMMER NO.1

     

    Output required:

    For 18, 19,  20 => 1st occurrence of output segment

    For 21, 22,  23, 24, 25 => 2nd occurrence of output segment

    For 26, 27 => 3rd occurrence of output segment

     

    FTX+AAA+++FREIGHT CONTRACTOR. 7 PIECE(S)'

    FTX+AAA+++BSP HAMMER NO.1 HYDRAULIC HOSES HAMMER NO.1 LEADERSECTION NO.6 LEADER 2 (LEADERHEAD) LEADERSECTION NO.4 LEADER 1 LEADERSECTION NO.4 LEADER 1'

    FTX+AAA+++LEADERSECTION NO.1 LEADER 1 (LEADERFEET) SUPPORTFRAME HAMMER NO.1 '

     

    I hope the requirement is clear.

    Any response would be helpful.

     

    Regards,

    SNK

     

     

     


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Split input based on condition

    Posted 04/18/16 04:10 AM
      |   view attached

    Originally posted by: paul.brett


    A component rule will help you split the two types of record input.  Please review the enclosed example.

    An example component rule I have used:

    MEMBER(RIGHT(TEXT($),1),{"1","2","3","4","5"})

    Thank-you.

    Paul.

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender

    Attachment(s)

    zip
    Grouping.zip   4 KB 1 version


  • 3.  Re: Split input based on condition

    Posted 04/18/16 04:45 AM

    Originally posted by: yeswtx


    Thanks Paul for the response.

    But this will not give me 3 occurrence of the output (as required) in a single output group rule for FTX(0:9).

    Let me know if you need more info.

     

    Thanks once again.


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: Split input based on condition

    Posted 04/18/16 06:49 AM

    Originally posted by: paul.brett


    Once you are armed with the input Typetree I have show, you can map the data thus:

    1|18|2|FREIGHT
    2|19|2|CONTRACTOR.
    3|20|2|7 PIECE(S)
    4|21|1|BSP HAMMER NO.1 
    5|22|1|HYDRAULIC HOSES HAMMER NO.1 
    6|23|1|LEADERSECTION NO.6 LEADER 2 (LEADERHEAD) 
    7|24|1|LEADERSECTION NO.4 LEADER 1 
    8|25|1|LEADERSECTION NO.5 LEADER 1 
    9|26|2|LEADERSECTION NO.1 LEADER 1 (LEADERFEET) 
    10|27|2|SUPPORTFRAME HAMMER NO.1

    ...with column 3 showing group membership, 1 or 2.  Then you could use control-break logic to split this into three groups, which you could then map with 3 calls to a functional map in a repeating group on output.

    It is entirely possible to do all this in one step, but I'll leave that for some more experienced mappers to demonstrate.

    Thank-you.

    Paul.

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Split input based on condition

    Posted 04/19/16 03:04 AM

    Originally posted by: yeswtx


    Thanks Paul,

    Control break will do the job, I still look for a logic to do this task in a single map rule.

     

     


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 6.  Re: Split input based on condition

    Posted 04/19/16 06:38 AM
      |   view attached

    Originally posted by: paul.brett


    It took a while (and it's not pretty) but I did it.  Output is 3 rows:

    [1][18][FREIGHT]:[2][19][CONTRACTOR.]:[3][20][7 PIECE(S)]
    [4][21][BSP HAMMER NO.1]:[5][22][HYDRAULIC HOSES HAMMER NO.1]:[6][23][LEADERSECTION NO.6 LEADER 2 (LEADERHEAD)]:[7][24][LEADERSECTION NO.4 LEADER 1]:[8][25][LEADERSECTION NO.5 LEADER 1]
    [9][26][LEADERSECTION NO.1 LEADER 1 (LEADERFEET)]:[10][27][SUPPORTFRAME HAMMER NO.1]

    Thank-you.

    Paul.

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange

    Attachment(s)

    zip
    Grouping2.zip   3 KB 1 version


  • 7.  Re: Split input based on condition

    Posted 04/19/16 11:57 AM

    Originally posted by: PrincesseJane


    C'est fantastique!


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender