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.  Split Data

    Posted 10/13/05 07:18 AM

    Originally posted by: SystemAdmin


    HI,

    I have a scenario where I get a single record(say InputRecord) which
    I need to split this InputRecord into Records which are 350 bytes each.
    Is there a automated way to do it.
    Instead of indexing the same record mutiple times and righting a MID each time with a different start position.

    RECORD[1]:MID(InputRecord,1,350)
    RECORD[2]:MID(InputRecord,351,350)
    .
    .
    .
    I do not like it doing this way is there a better automated way to do this.

    Thanks,
    Sai.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Split Data

    Posted 10/13/05 07:25 AM

    Originally posted by: SystemAdmin


    You could define your input record as multiple occurrances of 350 bytes.
    Record
    Data (350bytes) (S)
    That way you can deal with each chunk of data. It's a bit more tricky if your input record is not a multiple of 350 bytes though.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 3.  Re: Split Data

    Posted 10/13/05 07:27 AM

    Originally posted by: SystemAdmin


    Yeah!!! As you said that's where the tricky part is . My input is just coming as One Record.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Split Data

    Posted 10/13/05 07:30 AM

    Originally posted by: SystemAdmin


    I think so long as the data is defined as min 0 max 350 bytes then you should be ok.
    So a record is made up of 350 byte chunks until the last chunk which may be smaller.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Split Data

    Posted 10/13/05 07:50 AM

    Originally posted by: SystemAdmin


    Thanks for the reply janhess but i figured a easier way to do it.

    Thanks once again.

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


  • 6.  Re: Split Data

    Posted 10/14/05 01:06 AM

    Originally posted by: SystemAdmin


    Yould you like to share your solution?
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 7.  Re: Split Data

    Posted 10/14/05 08:03 AM

    Originally posted by: SystemAdmin


    I worked with Sai on this yesterday and what he ended up doing was to use a Functional map in conjunction with the CLONE function. Within the CLONE, he used the SIZE function to determine how big is input is and then divided by 350 to figure out how many instances his data actually needed. Outside of the SIZE, he added a NUMBERTOTEXT and then a FIND to determine if the divided number contained a decimal. When it does, he adds 1 to the number returned by the division and when it's even, it uses that number to control the number of times the CLONE should run the functional map. Within the functional map, he used the INDEX and MID to get the data from the string.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 8.  Re: Split Data

    Posted 10/14/05 08:14 AM

    Originally posted by: SystemAdmin


    Sounds very complex. Using multiples of 350 byte input data would be much simpler.
    Jan
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: Split Data

    Posted 10/14/05 08:29 AM

    Originally posted by: SystemAdmin


    Following on from what Jan mentions, rather than use a functional map, it might be easier (and more performant/efficient) to send the data blob (which is of an unknown number of records) to another map via the RUN command.

    This other map would simply have an input card of
    File
    -->Record (s)

    From what Sai has detailed in his initial post, each record is always of fixed length 350 characters. Hence, each Record is a text field of 350 characters.

    This map can then do whatever processing you need on each record.

    This is the simplest and easiest solution to your question.

    All the best

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


  • 10.  Re: Split Data

    Posted 10/14/05 08:35 AM

    Originally posted by: SystemAdmin


    You don't even need to make it that complicated.
    Type tree
    Record
    Data(s)

    Data has a size of 0 - 350

    Output card
    Same type tree
    Functional map in Data - =f_350bytes(Data:datain,numbertotext(index(Data:datain)))

    Functional map
    =put("FILE","splitfile"+ In2 + ".txt",In1)

    This generates a 350 byte file multiple times and the last file contains any remaining data.

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


  • 11.  Re: Split Data

    Posted 10/19/05 09:40 AM

    Originally posted by: SystemAdmin


    I would take the solution mentioned by Jennifer (Using the CLONE function and a fuctional map). It doesn't require changing the type trees and it only requires manipulating the input.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender