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


REXX general concepts

z/OS TSO/E REXX Reference
SA32-0972-00

The REstructured eXtended eXecutor (REXX) language is particularly suitable for:
  • Command procedures
  • Application front ends
  • User-defined macros (such as editor subcommands)
  • Prototyping
  • Personal computing. Individual users can write programs for their own needs.

REXX is a general purpose programming language like PL/I. REXX has the usual structured-programming instructions — IF, SELECT, DO WHILE, LEAVE, and so on — and a number of useful built-in functions.

The language imposes no restrictions on program format. There can be more than one clause on a line, or a single clause can occupy more than one line. Indentation is allowed. You can, therefore, code programs in a format that emphasizes their structure, making them easier to read.

There is no limit to the length of the values of variables, as long as all variables fit into the storage available.

Implementation maximum: No single request for storage can exceed the fixed limit of 16 MB. This limit applies to the size of a variable plus any control information. It also applies to buffers obtained to hold numeric results.

The limit on the length of symbols (variable names) is 250 characters.

You can use compound symbols, such as
NAME.Y.Z
(where Y and Z can be the names of variables or can be constant symbols), for constructing arrays and for other purposes.

Issuing host commands from within a REXX program is an integral part of the REXX language. For example, in the TSO/E address space, you can use TSO/E commands in a REXX exec. The exec can also use ISPF commands and services if the exec runs in ISPF. In execs that run in both TSO/E and non-TSO/E address spaces, you can use the TSO/E REXX commands, such as MAKEBUF, DROPBUF, and NEWSTACK. You can also link to or attach programs. Host commands and host command environments describes the different environments for using host services.

TSO/E REXX execs can reside in a sequential data set or in a member of a partitioned data set (PDS). Partitioned data sets containing REXX execs can be allocated to either the system file SYSPROC (TSO/E address space only) or SYSEXEC. In the TSO/E address space, you can also use the TSO/E ALTLIB command to define alternate exec libraries for storing REXX execs. For more information about allocating exec data sets, see z/OS TSO/E REXX User's Guide.

In TSO/E, you can call an exec explicitly using the EXEC command followed by the data set name and the "exec" keyword operand of the EXEC command. The "exec" keyword operand distinguishes the REXX exec from a TSO/E CLIST, which you also call using the EXEC command.

You can call an exec implicitly by entering the member name of the exec. You can call an exec implicitly only if the PDS in which the exec is stored has been allocated to a system file (SYSPROC or SYSEXEC). SYSEXEC is a system file whose data sets can contain REXX execs only. SYSPROC is a system file whose data sets can contain either CLISTs or REXX execs. If an exec is in a data set that is allocated to SYSPROC, the exec must start with a comment containing the characters "REXX" within the first line (line 1). This enables the TSO/E EXEC command to distinguish a REXX exec from a CLIST. For more information, see Structure and general syntax.

SYSEXEC is the default load ddname from which REXX execs are loaded. If your installation plans to use REXX, store your REXX execs in data sets that are allocated to SYSEXEC, not SYSPROC. This makes them easier to maintain. For more information about the load ddname and searching SYSPROC or SYSEXEC, see Using SYSPROC and SYSEXEC for REXX execs.

REXX programs are run by a language processor (interpreter). That is, the program is run line-by-line and word-by-word, without first being translated to another form (compiled). The advantage of this is you can fix the error and rerun the program faster than you can with a compiler.

When an exec is loaded into storage, the load routine checks for sequence numbers in the data set. The routine removes the sequence numbers during the loading process. For information about how the load routine checks for sequence numbers, see Exec load routine.

There is also a set of z/OS® UNIX extensions to the TSO/E REXX language which enables REXX programs to access z/OS UNIX callable services. The z/OS UNIX extensions, called syscall commands, have names that correspond to the names of the callable services that they invoke—for example, access, chmod, and chown. For more information about the z/OS UNIX extensions, see z/OS Using REXX and z/OS UNIX System Services.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014