This function returns the four‑character ID of the transaction that accesses CA Ideal.
This function has the following format:
$TRANSACTION‑ID
$TRANSLATE returns an alphanumeric value that consists of the argument value with all occurrences of specified characters translated to other specified characters.
This function has the following format:
$TRANSLATE (alphanumeric‑expression, FROM=from‑characters, TO=to‑characters)
The alphanumeric expression to convert.
The source characters for translation. This can be an alphanumeric literal or the name of an alphanumeric field or an alpha‑group. Each of the from‑characters must be unique. The number of from‑characters and to‑characters are usually in a one‑to‑one correspondence. If not, the length of the shorter character string is taken and the remainder of the longer string ignored.
If the lengths are not equal, a warning is issued during compilation.
If from‑characters is a literal and there is a duplication of one of the characters, a compile error is issued. If from‑characters is an identifier and there is a repetition of one of the characters, then the last occurrence is assumed.
Specifies the target characters for translation. This can be an alphanumeric literal, alphanumeric field, or alpha‑group.
Note: The reserved word parameters TO and FROM can appear in either order.
Examples
Assume that A and B are 16‑character alphanumeric fields.
SET A = 'ABC.DEF,GHI;JKL.' SET B = $TRANSLATE (A, TO='/$', FROM='.,') : convert periods to slashes and commas to dollar signs; result in B : is 'ABC/DEF$GHI;JKL/'. The result could have been assigned back : to A.
The following example illustrates how you can use $TRANSLATE to ensure that input that was entered in mixed case can process as all uppercase.
SET UPPER FIELD = $TRANSLATE(SOURCE‑FIELD, FROM='abcdefghijklmnopqrstuvwxyz', TO='ABCDEFGHIJKLMNOPQRSTUVWXYZ')
You could also use the $UPCASE function to do the same translation, if your site translation table, PMSTRUC, matches your requirements. $TRANSLATE is useful for situations where the translation to upper case also involves such things as removing accents.
In the following example, when you use the FROM character more than once, the corresponding rightmost TO value is used in the translation.
SET F1 = "111" SET T1 = "ABC" SET X1 = "1001" SET X2 = $TRANSLATE(X1,FROM=F1,TO=T1)
Therefore, the value of X2 is C00C.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|