IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
 View Only
  • 1.  How to map multiple records to one?

    Posted Wed April 06, 2016 02:34 AM

    Originally posted by: johnxp


    Hi, anyone can help me on below the situation?

    Input: (Structure: ID, Amt1, Amt2, Remarks)

    A, 100, 0, Test1

    B, 0, 200, Test2

    A, 100, 0, Test3

    ...

    B, 0, 100, Testn

    Output: (Structure: Text Line)

    Text Line = A,100,Test1; B,200,Test2; A,100, Test3; ...; B, 100, Testn;

    Logic: If ID = A, take Amt1, If ID = B, take Amt2

     

    Waiting for solution.

    Thanks.

     


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


  • 2.  Re: How to map multiple records to one?

    Posted Wed April 06, 2016 03:41 AM
      |   view attached

    Originally posted by: paul.brett


    Your output is still multiple records, but the record delimiter is just a semicolon (;) instead of a NewLine.

    Thank-you.

    Paul

    Follow me on Twitter


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

    Attachment(s)

    zip
    Example.zip   2 KB 1 version


  • 3.  Re: How to map multiple records to one?

    Posted Wed April 06, 2016 04:28 AM

    Originally posted by: johnxp


    We can do like that, however, the requirement is one text line only. I am just giving an example.

    I need one line free text output, it can be any format.


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


  • 4.  Re: How to map multiple records to one?

    Posted Wed April 06, 2016 05:27 AM

    Originally posted by: paul.brett


    Okay, so use my map as a RUN() map, and the result will be in one rule, and be one long string.

    Did you look at the example?

    Thank-you.

    Paul

    Follow me on Twitter


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


  • 5.  Re: How to map multiple records to one?

    Posted Wed April 06, 2016 06:07 AM

    Originally posted by: johnxp


    I tested your map, however, it's not exactly what I need.

    I need one line output without specific format.  


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


  • 6.  Re: How to map multiple records to one?

    Posted Wed April 06, 2016 10:41 AM

    Originally posted by: paul.brett


    Could you be more specific?  Given the input in the example, what is the exact output you require?  Currently I have:

    A,100,Test1;B,200,Test2;A,100,Test3;B,100,Test4

    Are you saying you want:

    A,100,Test1B,200,Test2A,100,Test3B,100,Test4

    Thank-you.

    Paul

    Follow me on Twitter


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


  • 7.  Re: How to map multiple records to one?

    Posted Wed April 06, 2016 10:22 PM

    Originally posted by: johnxp


    Thank you Paul.

    If the text output is the field of one fixed position output file, how to define it?

    For example:

    Field1 (10), Field2 (10), Text Field (according to your example, it's group field), Field3(20),....

    I got below the error:

    TYPE is FIXED, but COMPONENT (Text field) is not fixed TYPE (error).

     

     


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


  • 8.  Re: How to map multiple records to one?

    Posted Thu April 07, 2016 04:05 AM
      |   view attached

    Originally posted by: paul.brett


    OK, so I have implemented the mapping you suggested, but in a fixed format, you will need to have a fixed size in mind for this data.  What should happen if the input exceeds this fixed space assigned for the data?

    In my example, it is simply truncated at the 100 characters mark.

    As V.I.N.CENT said "A pint cannot hold a quart, Mr Pizer.  If it holds the pint, it's doing the best it can."

    Thank-you.

    Paul

    Follow me on Twitter


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

    Attachment(s)

    zip
    Example2.zip   4 KB 1 version


  • 9.  Re: How to map multiple records to one?

    Posted Thu April 07, 2016 06:18 AM