Replace ~ with a word in the NTE segment

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Replace ~ with a word in the NTE segment

  • Creator
    Topic
  • #54924
    Theresa Schenck
    Participant

      Is it possible to replace the special character (~) with a word in the NTE segment using a tcl proc?  Users are using the ~ instead of typing out the word approximately.  To make matters worse they may also use the & sign for the word and.  I am not sure if this is possible using a tcl pre proc script?  Has anyone done this before?  

      Thanks for any advice.

      Theresa

    Viewing 0 reply threads
    • Author
      Replies
      • #83471
        Jim Kosloskey
        Participant

          This can be done in a pre-proc. For the subcomponent separator it can also be done in an xltp proc.

          The challenge is you will need to know every field where this can happen and apply your logic at each field (whether pre or inside the Xlate).

          This is because the characters are valid separators erroneously placed. So if you were to do a ‘globa’l’ replacement pre you would change valid separators as well.

          The tilde replacement can be done in an Xlate with no Tcl I would think by using the ITERATE and CONCAT Actions (this assumes thee field in question is not repeating by definition).

          If the offending field is a repeating field then the issue gets even tougher (which tilde should really be replaced?). The NTE-3 where I suspect your current issue exists is a repeating field by definition – although perhaps not by local usage.

          The real solution lies with the source system. HL/7 has provision for escaping separators imbedded in text. The source system  should:

          –  Use the escape mechanism of the standard

          –  Stop the user from entering separaators at data entry.

          –  Provide replacement (and for & approx. for ~) at data entry.

          The above can have issues as well if there are potential field length constraints.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.