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.  Extracting rows based on UNIQUE data

    Posted 06/25/09 10:03 AM

    Originally posted by: mikeladd


    Morning everyone.

    I am trying to extract partner data from a file, but some of the records are duplicated.

    Data looks like this:

    F1 F2 F3 F4 F5
    TEST1|ZZ|PB000030|0001149|004010X091A
    test2|ZZ|PB000029|0004761|004010X091A1
    test2|ZZ|PB000029|0001378|004010X091A1
    test2|ZZ|PB000029|0055077|004010X091A1
    test2|ZZ|PB000029|0055077|004010X091A1
    test2|ZZ|PB000029|0049661|004010X091A1
    test3|ZZ|AH000599|B754|004010X091A1

    My unique ID's are the F3 & F4 fields. I can pass UNIQUE(F3) & File to an F_Map. But my problem is then getting JUST the unique rows based on the F4 ID's out of those results.

    I need to build XML data that looks similar to this

    <TP Info>
    <F1></F1>
    <F2></F2>
    <F3></F3>
    <AP INFO>
    <F4></F4>
    <F5></F5>
    </AP INFO>
    <AP INFO>
    <F4></F4>
    <F5></F5>
    </AP INFO>
    </TP INFO>

    I need a TP INFO tag for every unique F3 field, and at least one AP INFO tags for every unique F4 field.

    So I should have 3 TP INFO groups, but the second TP INFO should have 4 AP INFO groups, not 5

    My problem seems to be the initial Extract based on the F3. I am unable to Extract the UNIQUE rows for that F3 ID. Regardless of how I modify the rule, I keep getting an AP INFO tag for every F4 in the input, regardless of the logic used in the F_Map call.

    I can built it correctly using only one of the conditions, but not both.

    Hmm, may not have been the clearest description. Please let me know if I can provide more info.

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


  • 2.  Re: Extracting rows based on UNIQUE data

    Posted 06/25/09 10:04 AM

    Originally posted by: mikeladd


    Sorry, lost some formatting there.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Extracting rows based on UNIQUE data

    Posted 06/25/09 05:46 PM

    Originally posted by: repanzer


    Off-hand, how about an extra output card with a Group with X number of fields, then f_map(UNIQUE(F4)).

    Then pass that list to the XML output card until you need to:

    F_MAP(EXTRACT(record, F4=VALUE_FROM_LIST_of_first_output_card)

    I have no idea if that would work. I know what you want can be done, I would just have to code it myself to figure it out. If all else fails, I'll do that if I have time.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange