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.  Substitute Function in an element in a Type Tree

    Posted 03/01/07 10:57 PM

    Originally posted by: SystemAdmin


    I was wondering if someone could help me answer this question, if this is even possible? I need to add a function to an Name Element to remove a tilde (~) from the Name that is coming via EDI. The ~ is being used currently as a segment terminator in an EDI file. Thank you.

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


  • 2.  Re: Substitute Function in an element in a Type Tree

    Posted 03/02/07 02:13 AM

    Originally posted by: rajom777


    Didn't quite get what u actually want to do.. There is no need of a function here. If i am not wrong you need no ~ after the name element and if you have ~ as the segment delimiter already in your type tree it will take care of that..no need to trim it off...
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: Substitute Function in an element in a Type Tree

    Posted 03/05/07 02:04 PM

    Originally posted by: SystemAdmin


    If you mean that you are receiving a tilde within an element while the tilde is also used as a segment terminator, you may be out of luck. You might be able to use a SUBSTITUTE function if you know the exact field containing the errant tilde and the field is in a fixed position by creating a type tree of the form, TextBlob(of some defined length), NAME field, TextBlob. If you are receiving a variable length record file such as X12, I can't think of any easy way to remove the offending tilde.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 4.  Re: Substitute Function in an element in a Type Tree

    Posted 03/05/07 04:14 PM

    Originally posted by: NancyR


    Maybe I'm missing something here but if the tilde is the segment terminator and not the element terminator shouldn't SUBSTITUTE( Segment_Name, "~", "" ) work?

    For example, =SUBSTITUTE( NM1 Segment:LoopNM11000:Transaction #837 Outbound Partner Set V3050:EDI, "~", "" ) should remove the tildes from all the elements of the NM1 Segment and give you those elements delimited by whatever the element delimeter is.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 5.  Re: Substitute Function in an element in a Type Tree

    Posted 03/05/07 05:42 PM

    Originally posted by: jvanboga


    The problem is that when reading the file/record/segment and tilde is defined as a segment/record terminator it will assume that any tilde is the end of a segment. So this one segment would be treated as two segments and cause a validation issue when a map tried to read the input.....

    NM1*IL*1*VAN~JOHNSON*MARK****34*123456789~

    Also, even if you could use 'substitute()' how do you know what the substitute value should be? We get this type of issue a lot. In this case we would reject the file.

    If the symbol is defined as a delimiter it may not be as big of a deal but still needs to be addressed.


    Here's a possibility. Is the terminator '~' or '~<NL>'? If the terminator is the later and the extra ~ is missing the '<NL>' you could substitute the terminator with another unused character.


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


  • 6.  Re: Substitute Function in an element in a Type Tree

    Posted 03/05/07 06:58 PM

    Originally posted by: NancyR


    You're correct. The NM1 segment with the tilde as both data and syntax will never pass type tree validation. So, whether or not you use SUBSTITUTE to change the tilde's to nothing (""), the incoming data will not pass type tree validation unless your trading partner uses escape characters.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange