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.  Multiple Input Cards to Single Out Card

    Posted 07/15/13 03:57 PM

    Originally posted by: RPotteti


    Dear All,

    I have two different application systems sending message with same format. Requirement is to combine the input messages at output.

    Application 1:
    <AddressDetails>
        <Address>
            <City>chicago</City>
            <State>illinois</State>
            <Country>US</Country>
        </Address>
    </AddressDetails>

    Application 2:
    <AddressDetails>
        <Address>
            <City>indianapolis</City>
            <State>indiana</State>
            <Country>US</Country>
        </Address>
    </AddressDetails>

    Output:
    <AddressDetails>
        <Address>
            <City>chicago</City>
            <State>illinois</State>
            <Country>US</Country>
        </Address>
        <Address>
            <City>indianapolis</City>
            <State>indiana</State>
            <Country>US</Country>
        </Address>
    </AddressDetails>

    I need to use two input cards for each application. but as out put is only one, I am wondering how to achieve this using WTX. How can we merge two messages to one.

    Please let us know if anyone came across such situation. Thank you.

     


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


  • 2.  Re: Multiple Input Cards to Single Out Card

    Posted 07/17/13 11:20 AM

    Originally posted by: FormerBuckeye


    As you said, use two input cards and map the fields to a single output card that has two sets of address records.  Repeat as necessary.  You didn't mention if there is any logic linking the addresses from the two inputs aside from the next one in the file / received.


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


  • 3.  Re: Multiple Input Cards to Single Out Card

    Posted 07/17/13 02:31 PM

    Originally posted by: RPotteti


    Hi - Thanks for the response.

    Only logic is to append addresses from all apps.

    I am attaching schema file, input files, type trees and map for your reference. If you see the functional map section I am giving input from app1 and app2 to map to functional map.

    But once the functional map is created I am not sure how to append address from app2.


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

    Attachment(s)

    mtt
    RND_SORT.mtt   22 KB 1 version
    xsd
    RND_SORT.xsd   601 B 1 version
    xml
    APP2_Address_Input.xml   164 B 1 version
    mms
    SORT_RND.mms   2 KB 1 version
    xml
    APP1_Address_Input.xml   242 B 1 version


  • 4.  Re: Multiple Input Cards to Single Out Card

    Posted 07/17/13 12:54 PM

    Originally posted by: karthikpc


    Hi,

    Define your Output Type tree as below:

          Out_File    

               Address_From_application1(s)

               Address_From_application2(s)

    Since Application 1 and Application 2 sends data in the same format, Structure of Address_From_application2 should be identical to Address_From_application1.

    ------

    Now you can map Input1(s) to Address_From_application1(s) and Input2(s) to Address_From_application2(s).

     

    In result, you will get one concatenated output.

    --------

    If there are any conditions, then you will have to use functional Maps.

     

    Cheers

     


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


  • 5.  Re: Multiple Input Cards to Single Out Card

    Posted 07/17/13 02:39 PM

    Originally posted by: RPotteti


    Hi Karthik,

    Thanks for the response. If I use different names in the output schema, as the output is XML element tag names will be shown.

    And application team will not be able to make change at their end.

    As per your suggestion output will look like this:

    <AddressDetails>
        <Address_From_application1>
            <City>chicago</City>
            <State>illinois</State>
            <Country>US</Country>
        </Address_From_application1>
        <Address_From_application1>
            <City>Seattle</City>
            <State>Washington</State>
            <Country>US</Country>
        </Address_From_application1>
        <Address_From_application2>
            <City>indianapolis</City>
            <State>indiana</State>
            <Country>US</Country>
        </Address_From_application2>
    </AddressDetails>

    Is there any way we accomplish with out change in the names. Thanks for your response.


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


  • 6.  Re: Multiple Input Cards to Single Out Card

    Posted 07/17/13 09:58 PM

    Originally posted by: karthikpc


    Hi,

    I used different tag names to explain you the solution correctly.

    You can make the type tree changes as follows:

       Output:
            AddressDetails(s)

            AddressDetails(s)

    Map your application1 input(s) to first AddressDetails(s) and application2 input(s) to second AddressDetails(s). 

    now you should have the output as expected.

    Cheers

     

     


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


  • 7.  Re: Multiple Input Cards to Single Out Card

    Posted 07/18/13 10:15 AM

    Originally posted by: RPotteti


    Hi -

    I doubt if we can have a type tree with same element names.

    I tried but TX dosn't accept same name. Let me know if you made it work somehow.

    Thanks.

     


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


  • 8.  Re: Multiple Input Cards to Single Out Card

    Posted 07/18/13 12:08 PM

    Originally posted by: karthikpc


    Hi RP,

    Create your type tree as follows. So that you can use same name under one root. In your case Output.

    Output:
           File1(0:1) --------------------------------------------------> Implicit, No initiator, No Terminator

                 AddressDetails(s)                     

           File2(0:1)--------------------------------- ------------------> Implicit, No Initiator, No terminator

                 AddressDetails(s)                    

    ------------------------

    You may get a warning:  Component1(File1) may not be distinguishable from Component 2 (File 2). Ignore this warning because, you are using this type tree as a Output structure. So this will not be an issue.

     

    Now Map input1(s) to File1->AddressDetails(s) And Input2(s) to File2->AddressDetails(s)

    Cheers,

    KPC


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


  • 9.  Re: Multiple Input Cards to Single Out Card

    Posted 09/10/13 08:23 AM

    Originally posted by: Bhoju


    Cowboy coding...if you are unix guy write a shell script with below code and call it from one map... call another map using run map and read file33 and you are all set.

    #File1
    lineCount=`wc -l < file1 |sed 's/ //g'`
    #Remove Trailer
    linesToPull=`expr $lineCount - 1`

    #Retrieve the lines
    head -"$linesToPull" file1 > file11

     

    #File2
    lineCount=`wc -l < file2|sed 's/ //g'`
    #Remove header
    linesToPull=`expr $lineCount - 1`

    #Retrieve the lines
    tail -"$linesToPull" file2 > file22

    cat file11 file22 > file33

     


     


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


  • 10.  Re: Multiple Input Cards to Single Out Card

    Posted 10/09/13 05:03 AM
      |   view attached

    Originally posted by: paul.brett


    A working example


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

    Attachment(s)

    zip
    2into1.zip   8 KB 1 version