Trace; Translate; Trunc (Truncate) - IBM SC34-5764-01 Manual

Cics transaction server for vse/esa
Table of Contents

Advertisement

TRACE

TRACE(
option
returns trace actions currently in effect and, optionally, alters the setting.
If you specify option, it selects the trace setting. It must be one of the valid prefixes ? or ! or one of the
alphabetic character options associated with the TRACE instruction (that is, starting with A, C, E, F, I, L, N,
O, R, or S) or both.
Unlike the TRACE instruction, the TRACE function alters the trace action even if interactive debug is
active. Also unlike the TRACE instruction, option cannot be a number.
Here are some examples:
TRACE()
->
'?R' /* maybe */
TRACE('O')
->
'?R' /* also sets tracing off
TRACE('?I')
->
'O' /* now in interactive debug */

TRANSLATE

TRANSLATE(string
returns string with each character translated to another character or unchanged. You can also use this
function to reorder the characters in string.
The output table is tableo and the input translation table is tablei. TRANSLATE searches tablei for each
character in string. If the character is found, then the corresponding character in tableo is used in the
result string; if there are duplicates in tablei, the first (leftmost) occurrence is used. If the character is not
found, the original character in string is used. The result string is always the same length as string.
The tables can be of any length. If you specify neither translation table and omit pad, string is simply
translated to uppercase (that is, lowercase a–z to uppercase A–Z), but, if you include pad, the language
processor translates the entire string to pad characters. tablei defaults to XRANGE('00'x,'FF'x), and tableo
defaults to the null string and is padded with pad or truncated as necessary. The default pad is a blank.
Here are some examples:
TRANSLATE('abcdef')
TRANSLATE('abbc','&','b')
TRANSLATE('abcdef','12','ec')
TRANSLATE('abcdef','12','abcd','.')
TRANSLATE('APQRV',,'PR')
TRANSLATE('APQRV',XRANGE('00'X,'Q'))
TRANSLATE('4123','abcd','1234')
Note: The last example shows how to use the TRANSLATE function to reorder the characters in a string.
In the example, the last character of any four-character string specified as the second argument
would be moved to the beginning of the string.

TRUNC (Truncate)

TRUNC(number
,n
returns the integer part of number and n decimal places. The default n is 0 and returns an integer with no
)
,
tableo
,
tablei
->
'ABCDEF'
->
'a&&c'
->
'ab2d1f'
->
'12..ef'
->
'A Q V'
->
'APQ '
->
'dabc'
)
*/
)
,pad
Functions
195
Chapter 14. Functions

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rexx

Table of Contents