ReplaceChars
All validation programs
Performs any or all of these and stores the result in a variable:
-
Replaces characters that are not in the:
-
X12 basic character set
-
X12 extended character set
-
EDIFACT UNOA character set
-
EDIFACT UNOB character set
-
-
Replaces characters that are:
-
not alphanumeric
-
control characters
-
-
Replaces characters that you specify.
Format of Parameters
SourceString ResultVar CharsToReplace ReplacementChar
Where:
SourceStr
|
The string to be changed. This can be a string constant in double quotes, a variable, or a system variable like or . |
||||
ResultVar
|
The variable to contain the result. This can be the same variable name as specified in SourceString, if desired. | ||||
CharsToReplace
|
A string describing which characters to replace. See CharstoReplace on page CharstoReplace. |
||||
ReplacementChar
|
A string identifying the character that is to be used to replace all matched characters in CharsToReplace. This can be:
|
CharstoReplace
This can be one of the following:
Option |
Result |
---|---|
NonX12B |
Replace all characters not in the X12 basic character set. This character set includes: Uppercase letters Decimal digits Punctuation Characters ! " & ' ( ) * + , - . / : ; |
NonX12E |
Replace all characters not in the X12 extended character set. This character set includes: Uppercase letters Lowercase letters Decimal digits Punctuation Characters ! " & ' ( ) * + , - . / : |
NonUNOA |
Replace all characters not in the EDIFACT UNOA character set. This character set includes: Uppercase letters Decimal digits Punctuation Characters |
NonUNOB |
Replace all characters not in the EDIFACT UNOB character set. This character set includes: Uppercase letters Lowercase letters Decimal digits Punctuation Characters . , - ( ) / = ' + : ? |
NonAN |
Replace all characters that are not alphanumeric (not an uppercase or lowercase letter or a digit) |
LoCC |
Replace all control characters that have an ASCII value of 1 through 31 |
HiCC |
Replace all control characters that have an ASCII value of 128 through 255 |
AllCC |
Replace all control characters that have an ASCII value of 1 through 31 or 128 through 255 |
|
Replace all characters listed in ccc. Example To remove a single quote character, use two consecutive single quotes in the ‘ccc’ string. Example
|
Example 1
This example replaces all lowercase “c” characters with a capital C.
Assume that the current element contains col. John Crocker
SubmitterVar would then contain
.Col. John CroCker
Example 2
This example replaces any characters that are not in the X12 basic character set with uppercase X so that SpeciesVar contains TXXX XX X XXX
.
Example 3
Assume that the current element contains P. O. Box #1234
.
This example removes (not replaces) non-alphanumeric characters so that variable AddressVar contains P O Box 1234
.
Example 4
Assume that:
-
Variable PatPhoneVar contains
(614) 431-2345
-
Variable ReplCharsVar contains
"
List'() –'
"
Note the space between)
and -‘
-
Variable ReplWithVar contains
none
NewPatPhoneVar will contain 6144312345
.
Example 5
This causes KAVER Corporation#
to be put into variable CompanyNameVar.