I know exactly nothing about HealthShare... so I can just suggest two ways to remove the unwanted characters from a string:
use $zstrip()
set inpData="some wild sequence of characters"
set cleanData = $zstrip(inpData, "*C") // this removes all control characters (0x00-0x1f, 0x7f-0x9f)the other way is to define a set of valid characters and remove all others
set inpData="some wild sequence of characters"
set validChars = "012...89ABC..Zabc..z..."
set badChars = $translate(inpData, validChars) // remove from input all valid chars, leftover are bad chars
set cleanData = $translate(inpData, badChars) // remove all the bad charsor just the short version
set cleanData = $translate(inpData, $translate(inpData, validChars))- Log in to post comments