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.  Creating X'12 from flat file

    Posted 10/13/14 02:44 PM

    Originally posted by: monika_srivastava


    Hi,

    I am new to IBM WTX and looking for solution to one problem I am facing.

    I have to create X'12 from a flat file.

    So my input card is  Flat file type tree and Output is X'12 type tree.

    My file looks something like this

    XXX    YY1

    XXX    YY1

    XXX    YY2

    XXX    YY2

    XX1    YY1

     

    Column 1 contains some value and column 2 contain some values.

    After reading a file, whenever the combination of coulmn1 and colunm2 chnages I have to create a new X'12.

    So I have created a map and called a functional map from it.

    From Map I have passed (Colum1,column2,file) as argumnets and called a functional map.

    In the functionla map I am puuting mapping logic.

    When I am running this. The whole file is read but It does not create separe X'12.

    Infact only first row's value of column1 and column2 are created, rest all are not coming.

    So basically it is question of how I can create loops in the maps. I ahve tried to explain with sample examples.

    Any quick. help is appreciated.

     

    I need to create new ISA segment every time COL1 and COL2 combination changes


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


  • 2.  Re: Creating X'12 from flat file

    Posted 10/14/14 04:57 AM

    Originally posted by: paul.brett


    This can be done with either Control-Break logic (alteration of he Typetree) or using a combination of UNIQUE() and EXTRACT() if you want to do it with mapping (which is potentially less efficient).

    One trick you might want to do, is to read the input into a temporary structure, with an additional field, that is your two key fields concatenated together.  You could then use this single field as a way of identifying unique rows, and extracting matching data.  Example : XXXYY2.

    See my example in the post 'Splitting records in a file to different Transaction sets based on an Id'

    Thank-you.

    Paul.

    Follow me on Twitter


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


  • 3.  Re: Creating X'12 from flat file

    Posted 10/14/14 05:04 AM

    Originally posted by: monika_srivastava


    Thanks Paul.
    i alreday chceked it.
    I tried putting it but its not working.
    I have one more problem that even though there are 10 records in the file , I am reading file through functional map(record), it is creating 10 ISA segment, but it is populating data from the first row only.So all ISA segment has same data.
    First I wanted to start with basic.
    I want to read a file with 10 records and create 10 X'12 in the same fiel.

    Once that is done I will do the control break logic.
    Can you please reply to this.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: Creating X'12 from flat file

    Posted 10/14/14 05:24 AM

    Originally posted by: paul.brett


    I recommend you send IBM your input data and the Typetree/Map you have already designed, so it can be checked.  You can do this in the forum, but I recommend you instead open a PMR, as this sounds like it might get complicated.

    Thank-you.

    Paul.

    Follow me on Twitter


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


  • 5.  Re: Creating X'12 from flat file

    Posted 10/24/14 10:50 AM
      |   view attached

    Originally posted by: paul.brett


    An example, based on the input supplied for this post, is attached.

    Output1.txt shows the number of segments, which is 3.  The combination of column 1 and 2 changes give three segments.

    Output2.txt shows that each segment receives the correct data from input.

    Thank-you.

    Paul.

    Follow me on Twitter


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

    Attachment(s)

    zip
    Control-Break.zip   15 KB 1 version