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 get the previous record from flat file

    Posted Fri April 13, 2018 01:34 PM

    Originally posted by: tverma


    Can someone please help me to get the previous records from flat file.

    I have created outbound map (flat file to X12 file) on WTX tool, below is my requirement:

     

    Flat file layout

     

    1. HDR…543…877.

    2. DTL..12……

    3. DTL..32…..

    4. DTL..56…..

    5. DTL..76……

    6. TRL..56…4455

     

    In flat file HDR record will come one time, DTL records will repeat up 0 to 999 times and TRL record will come only one time.                                                                                                                                                                                                                                             

    If I will be in line no 3rd  then how can I get line no 2nd line data (Position 5th  to 7th field I want in 3rd line and this field doesn't have any mapping with X12 fields).

     

    Any help would be appreciated!

     


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


  • 2.  Re: How to get the previous record from flat file

    Posted Mon April 16, 2018 05:03 PM

    Originally posted by: Bragger


    Call a functional map and use index function, [LAST] to get data from previous record. For e.g. if "Field1" is appearing in Group multiple times then use this field like this - Field1[LAST]:Group.

     

    Other solution would be to create a temporary card and assign incremental number to each record and name this field as "Index". Then in your main Output pass Temporary group and INDEX($) as argument to your functional map. Use look up to compare this Index of functional map and "Index" field of temporary Output card to get the previous record.


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


  • 3.  Re: How to get the previous record from flat file

    Posted Tue April 17, 2018 04:56 AM


  • 4.  Re: How to get the previous record from flat file

    Posted Tue April 17, 2018 08:43 AM

    Originally posted by: tverma


    Thanks Bragger & Paul for response! It worked fine.


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