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.  Need to implement loop feature

    Posted 06/23/09 02:57 AM

    Originally posted by: SystemAdmin


    Hi,
    I need to write a rule for an output item which will return the required field from a list send as input corresponding to the specified condition. For e.g. suppose if we have two records: REC1 and REC2 having loops as DTL1(s) and DTL2(s). DTL1 group contains EMPID field and AMT Field and DTL2 group contains EMPID field and CREDITNUM Field. Now I need to write a rule such that it return CREDITNUM Field from DT2 group for the condition where EMPID from DTL1 matched with EMPID from DTL2.

    I am using this way but it is not working:
    LOOKUP(CREDITNUM Fields:DTL2:REC2,EMPID Fields:DTL2:REC2 = SEARCHUP(EMPID Fields:DTL1:REC1,EMPID Fields:DTL1:REC1,EMPID Fields,DTL2:REC2))

    By this way if I am passing REC1 and REC2 as input, it only gives a first record, but what if every DTL group contains more than 1 record?

    E.g. for input ():
    REC1:(Header,EMPID,AMT) (Header,EMPID,CREDITNUM)
    D,1234,23.45 D,1234,AC123
    D,9876,45.67 D,9876,AC987
    D,6745,67.78 D,6745,AC546

    Thanks in advance,
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: Need to implement loop feature

    Posted 06/23/09 02:14 PM

    Originally posted by: repanzer


    I'm confused by your layout. Rec1 and Rec2 contain detail records??

    You have two input files, each file has S number of Recs, each Rec has S number of dtl1 and dtl2 groups, DTL1 has EMPID:AMT, DTL2 has EMPID:CreditNum??/

    File1
    Rec1(s)
    Dtl1(s)
    EMPID,AMT
    dtl2(s)
    EMPID,CreditNum
    File2
    Rec2(s)
    Dtl1(s)
    EMPID,AMT
    dtl2(s)
    EMPID,CreditNum
    ???

    Off hand, I would say split up your rule and make sure each peice is working correctly.

    Run this; SEARCHUP(EMPID Fields:DTL1:REC1,EMPID Fields:DTL1:REC1,EMPID Fields,DTL2:REC2)

    And make sure you're getting the data you want. If you are, hardcode that value in;

    LOOKUP(CREDITNUM Fields:DTL2:REC2,EMPID Fields:DTL2:REC2 = HARDCODED VALUE)

    And make sure you're getting what you want.

    After you clarify the structure a bit, I may have a more info.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender