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.  COUNT of Segments

    Posted 08/09/06 04:05 PM

    Originally posted by: snutakki


    Hi ,

    I have a Loop that can repeat upto 1000 times.
    I am getting a Input file with the Loop repeating 100 times.
    I need to count the total number of SEGMENTS in the
    First 50 occurances of that Loop.
    What is the easiest way to do this.
    any help is greatly appreciated.

    Thanks,
    sai.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: COUNT of Segments

    Posted 08/09/06 06:04 PM

    Originally posted by: jvanboga


    There are a number of ways to do this... It really depends on your needs...

    One is to create a map with two outputs. the first a functional map, Input is the loop and an index. output is your count which can occur multiple times. The second card would sum the output of the first card.

    card1 rule:
    f_map_count_segments (loop, index($))

    rule = if (loop_count < 51, count(segments))

    card2 rule:
    sum (card1)

    If you have unused filler in your output you could use it to contain a count which you could later sum.

    You can also play with the type tree.

    How you really want to do this depends on a lot of things. How many times do you want to process/read the file? Where do you want to store the output? etc....
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender