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.  Populate optional element value

    Posted 08/04/11 01:18 PM

    Originally posted by: Liv2luv


    Right now I am working on a map containing 2 input cards (XML input) and an output card(XML output). Some elements in one of the input cards are optional which is making the output not appear as expected.

    With no luck, I am trying to check the presence of element using ABSENT() and CLONE() that area with spaces

    
    =IF( MID(In1,2934,3)=TEXT(LineNumber:sequence:In2), ( MID(In1,1,3591) + FILLRIGHT(ServiceGroupId:sequence:In2,
    " ",4) + FILLLEFT(TEXT(ServiceId:sequence:In2),
    "0",4) + IF( ABSENT(ServiceIdDiagCode:sequence:In2), CLONE(
    " ",8), FILLRIGHT(ServiceIdDiagCode:sequence:In2,
    " ",8) )+ FILLRIGHT(DiagCodeGroupId:sequence:In2,
    " ",4) + MID(In1,3806,1195) ) )
    


    Any clue about padding the area with spaces if the optional element is not populated will be helpful.

    Thanks.

    P.S: I do not have type trees defined as I'm using ver 8.3.0.3. Mapping is done directly using the schemas.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Populate optional element value

    Posted 08/04/11 04:37 PM

    Originally posted by: JGibby


    CLONE is not the function you want to use. Try this:

    
    =IF( MID(In1,2934,3)=TEXT(LineNumber:sequence:In2), ( MID(In1,1,3591) + FILLRIGHT(ServiceGroupId:sequence:In2,
    " ",4) + FILLLEFT(TEXT(ServiceId:sequence:In2),
    "0",4) + FILLRIGHT(ServiceIdDiagCode:sequence:In2,
    " ",8) + FILLRIGHT(DiagCodeGroupId:sequence:In2,
    " ",4) + MID(In1,3806,1195) ) )
    


    If that doesn't work for you, try this:
    
    =IF( MID(In1,2934,3)=TEXT(LineNumber:sequence:In2), ( MID(In1,1,3591) + FILLRIGHT(ServiceGroupId:sequence:In2,
    " ",4) + FILLLEFT(TEXT(ServiceId:sequence:In2),
    "0",4) + FILLRIGHT(EITHER(ServiceIdDiagCode:sequence:In2,
    " "),
    " ",8) + FILLRIGHT(DiagCodeGroupId:sequence:In2,
    " ",4) + MID(In1,3806,1195) ) )
    


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


  • 3.  Re: Populate optional element value

    Posted 08/04/11 05:11 PM

    Originally posted by: Liv2luv


    That was precise. The second approach did the trick.

    I've tried the first approach and it only works if there is some value in the element.

    Thanks again!
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender