IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
 View Only
  • 1.  Type Tree problem with repeating records on input

    Posted Thu June 16, 2005 06:52 AM

    Originally posted by: SystemAdmin


    I want to split a file that is a continous stream of text without any delimiter/CR, into repeating records and have problems describing the type tree.

    The stream has the following structure:

    header(fixed size)
    recordheader(fixed) record(initiator/size unknown)
    trailer(fixed)
    I created the type tree as above, but on input the repeating records are not recognized. The "record" is filled with the whole remaining text stream and is not split up.
    I suppose this is because I have not specified a terminator, but I dont really have one...

    Anyone got an idea?

    Thanks alot.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: Type Tree problem with repeating records on input

    Posted Thu June 16, 2005 06:58 AM

    Originally posted by: SystemAdmin


    I think all you could do with this is to read in a single blob of data, strip off the fixed bits and leave the variable length bit to process. With no identifiers you can't determine where the trailer starts.
    I did once process a file like this but the record headers had the length of the record in them so I was able to use this within the map to split up the records.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Type Tree problem with repeating records on input

    Posted Thu June 16, 2005 07:15 AM

    Originally posted by: SystemAdmin


    Pre-process the file to get delimiters.

    Counting the number of record initiators, and then using this count to go through a fixed number of loops.

    Each loop, use the FIND option to get the position of a record initiator, and then counting backwards the fixed length of the record header to insert a row delimiter.

    Once the whole file has been altered in this process, you should be able to pass it through a second typetree for main mapping.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Type Tree problem with repeating records on input

    Posted Thu June 16, 2005 07:42 AM

    Originally posted by: SystemAdmin


    Thats great thanks alot!

    For the loop is there anything better than passing this to a functional map?

    CLONE(file, COUNTSTRING(file, initiator))
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Type Tree problem with repeating records on input

    Posted Thu June 16, 2005 08:11 AM

    Originally posted by: SystemAdmin


    I wouldn't CLONE the file as this might use way too much memory. Just cloning a single character would create a file that you could use.

    This file would form the basis of a dummy input to get the right number of loops.

    first step use a LEFT() to get the beginning of the file, append this to output

    loop around Y times, getting a MID() each time, append a <NL> and this to the output file. (or any other row delimiter you like)

    On the last loop get all the data, then use a LEFT() to remove the trailer.

    lastly use a RIGHT() to grab the last bit of the file.

    STart by making each step a map, and then when it's all working as you would expect, try to chain them all together.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 6.  Re: Type Tree problem with repeating records on input

    Posted Fri June 17, 2005 06:56 AM

    Originally posted by: SystemAdmin


    You should be able to use the record initiator record header combination to put a rule in the tree to help distinguish the records. I think the data has multiple records before the trailer?
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender