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.  COBOL copybook importer

    Posted 09/09/05 08:00 AM

    Originally posted by: SystemAdmin


    DSTX all versions.

    I found an interesting anomaly with the TypeTree COBOL copybook importer.
    It imports text fields as size 0 to n (n in this case is 10) and padded to fixed size with spaces.
    This seems fine and reads the data ok.
    However, I have a 10 character field which I want to test the last character as "-". The data can contain 9 or 10 characters such as
    abcdefgh- or abcdefgh--. If I use the rule
    IF(Right(datain,1) = !"-", do choice 1 , do choice 2) it always does choice 2. I would have expected the 9 character data to obey choice 1.
    However, DSTX treats character 10 as a pad character and so it's not part of the data and therefore the last character is always "-"
    If the data is described as min 10 and max 10 then the rule behaves as expected.
    I would have thought the cobol importer should have set the min and max values the same - cobol data often contains pad characters that are considered part of the data.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: COBOL copybook importer

    Posted 09/09/05 08:16 AM

    Originally posted by: SystemAdmin


    Is this valid: "IF(Right(datain,1) = !"-", "?

    I would think it should be: "IF(Right(datain,1) != "-","

    There are complexities of the COBOL Copybook importer you have to learn to account for. The padding occasionally bites you especially with numbers and dates as spaces aren't numbers and zeroes aren't valid dates. You can accommodate some issues by using the EMPTY option.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: COBOL copybook importer

    Posted 09/09/05 08:20 AM

    Originally posted by: SystemAdmin


    Sorry, typo.
    It should be IF(Right(datain,1) != "-", do choice 1 , do choice 2)
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: COBOL copybook importer

    Posted 09/09/05 08:27 AM

    Originally posted by: SystemAdmin


    How about "IF(MID(datain,10,1) != "-", "?
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 5.  Re: COBOL copybook importer

    Posted 09/12/05 05:45 AM

    Originally posted by: SystemAdmin


    Jim,
    That wouldn't work as if character 10 is a space it doesn't exist - it's a pad character.
    I would have expected the importer to set each field with min and max size the same which would be a better fit to cobol data definitions.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 6.  Re: COBOL copybook importer

    Posted 09/14/05 06:45 AM

    Originally posted by: SystemAdmin


    Perhaps I'm not clear on your input data. I believe it will work. You may have to adjust your logic.

    IF Then
    abcdefgh- MID(datain,10,1) = NULL
    abcdefgh-- MID(datain,10,1) = "-"

    I expected the COBOL copybook importer to create fixed length fields also. I've exported the type tree and run scripts against the export to set all fields to fixed length.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 7.  Re: COBOL copybook importer

    Posted 09/14/05 07:48 AM

    Originally posted by: SystemAdmin


    Yes Jim, you're right. It would return null. It works the same way as RIGHT.
    The problem would be if I wanted to test character 10 = space. The result would never be true. So I could not have a rule that matched the data. This recently caused us a lot of confusion with a recent problem.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 8.  Re: COBOL copybook importer

    Posted 09/14/05 08:25 AM

    Originally posted by: SystemAdmin


    Sorry, I failed to read your mind. 8-)

    "want to test the last character as "-"." is not the same as "wanted to test character 10 = space"

    Apparently to you "-" is a space but to me it's a hyphen.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 9.  Re: COBOL copybook importer

    Posted 09/14/05 09:40 AM

    Originally posted by: SystemAdmin


    Character 9 is a hyphen, character 10 is a space but space is a pad character so dstx does not recognise it as a space so I can't say if character10 = space do something, as it would always evaluate the space as a null.
    Anyway I've sorted it now.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender