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.  Index manipulation within a Functional Map

    Posted 01/14/08 10:01 AM

    Originally posted by: DianeC


    I have 3 inputs to a FMap. One is a field that I pass to use as an index on a field from one of the other inputs. I need to be able to pass that (index) value back to the calling map and then back again into the FMap without it getting changed. It'll get changed in the functional map. Does anyone have a suggestion on how to do that?
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Index manipulation within a Functional Map

    Posted 01/14/08 10:06 AM

    Originally posted by: janhess


    Sounds like it would be better to change your design so that you know the value before passing it to the fmap. Can you do it in a previous card?
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: Index manipulation within a Functional Map

    Posted 01/14/08 10:49 AM

    Originally posted by: DianeC


    I'm not really sure what you're asking, but the FMap gets called because there is a loop. Inside this FMap the value gets changed because one of the inputs has a field that determines if the index gets incremented or decremented before writing a different field to the output.

    We are using WTX 8.1.0.1.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 4.  Re: Index manipulation within a Functional Map

    Posted 01/14/08 12:43 PM

    Originally posted by: SystemAdmin


    GETANDSET(), maybe?

    I am a bit confused.

    f_map( Input1, Input2, IndexOnFieldInInputx)

    And you use the index in the f_map, but want it to go back to the original value for each f_map run?

    I don't know if this would work, but:

    f_map( Input1, Input2, IndexOnFieldInInputx-1)

    Message was edited by: rep
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 5.  Re: Index manipulation within a Functional Map

    Posted 01/14/08 01:25 PM

    Originally posted by: DianeC


    No, I want the value to remain what it's set to within the FMap.
    F_Map(In1, In2, IndexOnFieldX)
    .
    .
    .
    IF (FieldX = "D", /*move*/ FieldY(Index - 1):In2......

    If the 'index' gets incremented or decremented, I need that to be the same value when I re-enter this F_Map for the next loop.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 6.  Re: Index manipulation within a Functional Map

    Posted 01/14/08 02:46 PM

    Originally posted by: SystemAdmin


    I can only try to see if what I say offers a route to take, but..

    Possible what jahness was mentioning when using another card...
    Maybe have your first output card as just a numeric field, and put the value you want for the first f_map run. That value will always be the one you manipulate using GETANDSET(). I believe the index will always change, but maybe depending on the results, you can manipulate the GETANDSET value. Something like...

    fmap(Input1, Input2, Index, getnsetfield:outputcard1)..

    In the F_map map rule

    =IF (FieldX = "D", /*move*/
    GETANDSET(FieldY(Index) , INDEX(fieldY)-1 {new value} , 1 or 2 based on what value you want for the next map run)

    I don't know, but it maybe worth a shot, if you can put logic with the get and set, like,
    IF INDEX(FIELDY) > INDEX(FIELDY{LAST}), GETANDSET(INDEX(FIELDY), INDEX(FIELDY)-1, 1)
    else, GETANDSET(INDEX(FIELDY), INDEX(FIELDY), 2)

    Something like that maybe (?)...

    good luck

    Message was edited by: rep
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Index manipulation within a Functional Map

    Posted 01/14/08 02:54 PM

    Originally posted by: SystemAdmin


    Not sure if this is what you're going for, but this preserved the index number across functional maps for me:

    =f_FunctionalMap(Item1:RowIn:Input,
    Item2:RowIn:Input,
    IF(PRESENT(CurrentIndex:RowOutLAST:Output),CurrentIndex:RowOutLAST:Output, 1))

    with brackets around the LASTs (darn HTML formatting...)

    Jesse

    Message was edited by: jmenning
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: Index manipulation within a Functional Map

    Posted 01/23/08 09:08 AM

    Originally posted by: DianeC


    I ended up changing the logic (design). Thanks to everyone anyway!!!
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: Index manipulation within a Functional Map

    Posted 01/14/08 10:29 AM

    Originally posted by: jvanboga


    What version are you running? (ignore - was thinking there was a function avail in the newer versions)

    Message was edited by: jvanboga
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange