*TRANSLATE ( operand
|
, | LOWER
|
)
|
||
UPPER
|
Format/length: same as operand.
This document covers the following topics:
The Natural system function *TRANSLATE
converts the
characters of an alphanumerical or binary operand to upper case or lower case.
The content of the operand is not modified.
*TRANSLATE
may be specified as an operand in any position
of a statement wherever an operand of format A, U or B is allowed.
When using the system function *TRANSLATE
, the following
restrictions apply:
*TRANSLATE
must not be used where a target variable is
expected.
You may not nest *TRANSLATE
in a system function.
Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand
|
C | S | A | A | U | B | yes | no |
Syntax Element Description:
DEFINE DATA LOCAL 1 #SRC (A)DYNAMIC INIT <'aBcDeFg !§$%&/()=?'> 1 #DEST (A)DYNAMIC END-DEFINE * PRINT 'Source string to be translated..........:' #SRC * MOVE *TRANSLATE(#SRC, UPPER) TO #DEST PRINT 'Source string translated into upper case:' #DEST * MOVE *TRANSLATE(#SRC, LOWER) TO #DEST PRINT 'Source string translated into lower case:' #DEST END
Output:
Source string to be translated..........: aBcDeFg !§$%&/()=? Source string translated into upper case: ABCDEFG !§$%&/()=? Source string translated into lower case: abcdefg !§$%&/()=?