z/OS TSO/E Customization
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Writing an exit for installation-written built-in functions (IKJCT44B)

z/OS TSO/E Customization
SA32-0976-00

This section describes the exit you can use to add your own CLIST built-in functions.

The CLIST language provides built-in functions that can be performed on variables, expressions, and character strings. CLIST processing evaluates the variable or expression, if necessary, and then performs the requested function.

To use a CLIST built-in function, specify its name, followed by the variable, expression or character string in parentheses. The variable, expression or character string is called the argument of the built-in function.

, describes the CLIST built-in functions that are supplied by TSO/E. In addition to these built-in functions, TSO/E provides a built-in function exit that you can use to add your own CLIST built-in functions.

Processing for a CLIST is done in two steps: phase 1, which is performed by the EXEC command processor, and phase 2. In phase 1, the EXEC command processor reads the CLIST records from the input data set and builds an in-storage command procedure. EXEC then places the command procedure that it built on the input stack. This stack is maintained by TSO/E to determine the source of input. Phase 2 processing receives control as each record is removed from the stack. The CLIST built-in function exit receives control during phase 2 processing. When the exit receives control, all symbolic substitution has been performed on the argument of the built-in function.

Names of installation-written built-in functions must begin with the prefix &SYSX and have from 1 to 248 additional characters. Built-in function names must follow the rules for naming symbolic variables described in .

When CLIST processing encounters a variable with the &SYSX prefix that has not been defined, it passes control to the CLIST built-in function exit, if one exists. Then, if the exit successfully evaluates the built-in function, CLIST processing replaces the built-in function (name and argument) with the result of the evaluation.

Some ways you can use the CLIST built-in function exit include:
  • Performing text manipulation, such as determining the prefix or suffix of a string, or reversing the order of the characters in a string
  • Performing arithmetic calculations, such as determining the mean of a series of numbers
  • Defining built-in variables to return a value. A built-in variable is similar to a built-in function, except that it is not followed by an argument. For example, you can use the CLIST built-in function exit to define a built-in variable, &SYSXMVS, that returns the level of MVS™ installed on your system.
Note: The built-in function exit cannot distinguish between built-in functions and built-in variables. Therefore, do not specify an argument after a built-in variable because errors can result.
TSO/E also provides several other exits that you can use to customize CLIST processing:

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014