Using built-in functions

The CLIST language includes built-in functions that you can perform on variables, expressions, and character strings. If necessary, CLIST evaluates the variable or expression first, and then performs the requested function. The CLIST then stores the result under the name of the built-in function.

To use a built-in function, type its name, followed by the variable, expression, or character string in parentheses. The variable, expression, or character string is also called the argument of the built-in function. The argument must immediately follow the built-in function name, with no blanks between them. Table 1 describes each of the built-in functions briefly and gives page numbers where you can find more information.

Table 1. Built-in functions
Built-in function Function Reference
&DATATYPE(expression) Indicates whether the evaluation of expression is a character string or a numeric value. Determining the data type of an expression - &DATATYPE
&EVAL(expression) Performs an arithmetic evaluation of expression. Forcing arithmetic evaluations - &EVAL
&LENGTH(expression) Evaluates expression if necessary and indicates the number of bytes in the result. Determining an expression's length in bytes - &LENGTH
&NRSTR(string) Preserves double ampersands, defines non-rescannable strings. Preserving double ampersands - &NRSTR
&STR(string) Defines data to be used as a character string. Defining character data - &STR
&SUBSTR(exp[:exp],string) Uses certain bytes in a character string. Defining a substring - &SUBSTR
&SYSCAPS(string) Converts the string to uppercase characters. Converting character strings to uppercase characters - &SYSCAPS
&SYSCLENGTH(expression) Evaluates expression if necessary and indicates the number of characters in the result. Determining an expression's length in characters - &SYSCLENGTH
&SYSCSUBSTR(exp[:exp],string) Uses certain characters in a character string. Defining a substring - &SYSCSUBSTR
&SYSDSN(dsname[(member)]) Indicates whether the specified data set exists. Determining data set availability - &SYSDSN
&SYSINDEX(string_1,string_2[,start]) Finds the position of a character string (string_1) within another (string_2), from a specific starting point. Locating one character string within another - &SYSINDEX
&SYSLC(string) Converts the string to lowercase characters. Converting character strings to lowercase characters - &SYSLC
&SYSNSUB(level,expression) Limits the level of symbolic substitution in the expression. Limiting the level of symbolic substitution - &SYSNSUB
&SYSONEBYTE(string) Converts a string of data from the double-byte character set (DBCS) to EBCDIC. Converting DBCS data to EBCDIC - &SYSONEBYTE
&SYSTWOBYTE(string) Converts a string of data from EBCDIC to the double-byte character set (DBCS). Converting EBCDIC data to DBCS - &SYSTWOBYTE

In addition to these built-in functions, TSO/E provides an installation exit that lets your installation add its own CLIST built-in functions. For information about the exit, see z/OS TSO/E Customization.

Note: With the exception of &SYSNSUB, built-in functions will not resolve double ampersands (&&) that appear in an argument.