IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
  • 1.  Optional

    Posted Thu December 03, 2015 05:33 AM

    Originally posted by: Semoul


    I have a .csv file as input where the records are delimited by <NL>.

    The problem is that the last record may be terminated by a <NL>, but it is optional.

    What is the best way to handle this in the Type Tree?

     

    Thank you very much.


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


  • 2.  Re: Optional

    Posted Thu December 03, 2015 06:32 AM

    Originally posted by: paul.brett


    Set the row delimiter to Infix, and let the engine just 'ignore' the fact that there's no 'last' record.  Your trace should show something like:

    (Level 1: Offset 9, len 7, comp 1 of 1, #2, DI 0000000A:)
    Data at offset 9 ('1,2,3,4') was found to be of TYPE
       X'0003' (Row root).

    (Level 2: Offset 18, len 0, comp 1 of 4, #1, DI 0000000B:)
    Data at offset 18 ('(end of data)') was found to be of TYPE
       X'0005' (TextItem1 TextItem root).

    (Level 2: Offset 18, len 0, comp 2 of 4, #1, DI 0000000B:)
    COMPONENT number 2 of TYPE X'0003' (Row root)
      is required, but does not exist.

    (Level 1: Offset 18, len 0, comp 1 of 1, #3, DI 0000000B:)
    COMPONENT number 1 of TYPE X'0002' (File root):
    occurrence 3 is optional and has no content.

    (Level 0: Offset 0, len 18, comp 1 of 0, #1, DI 0000000B:)
    Data at offset 0 ('a,b,c,d<CR><LF>1,2,3,4') was found to be of TYPE
       X'0002' (File root).

       INPUT 1 was valid.

     

    I hope that helps.

     

    Thank-you.

    Paul

    Follow me on Twitter


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


  • 3.  Re: Optional

    Posted Thu December 03, 2015 07:03 AM

    Originally posted by: Semoul


    I suppose your example works because your "Row root" has no structure defined?

    I get an "INPUT 1 was valid but contained 2 bytes of unknown data at the end" error.

    I could set those warnings to "ignore" in the map settings, but I don't want to do that.


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


  • 4.  Re: Optional

    Posted Fri December 04, 2015 04:03 AM

    Originally posted by: Laurent(Satisco)


    I'd go one step further: rather than setting this warning to 'ignore' , I usually set it to 'Fail' as the danger is high of losing data in this case (when it's 2 bytes it's OK, but could be anything else).

     

    Paul's recommendation should work, there could be another issue in your tree.


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


  • 5.  Re: Optional

    Posted Fri December 04, 2015 05:10 AM

    Originally posted by: paul.brett


    You could add another (optional) dummy object at the end of your current Typetree group, so "soak-up" those 2 bytes.

    Thank-you.

    Paul

    Follow me on Twitter


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