Reference articles on history, science, culture and more
Encyclopedia

EXEC 2

EXEC 2 is an interpreted, command procedure control, computer scripting language used by the EXEC 2 Processor originally supplied with the CMS component of the IBM Virtual Machine/System Product (VM/SP) operating system.

01Relation to EXEC

EXEC 2 is mostly compatible with CMS EXEC but EXEC 2 scripts must begin with an &TRACE statement. Some EXEC statements and predefined variables do not exist in EXEC 2, although in some cases there are analogs. There are some minor differences in some statements and predefined functions.

EXEC 2 has the following enhancements:

  • There is no 8-byte restriction on token length.
  • Statements can be up to 255 characters long.
  • EXEC 2 can issue commands to subcommand environments as well as CMS and CP.
  • EXEC 2 has additional built-in functions.
  • EXEC 2 has user-defined functions.
  • EXEC 2 commands may include subroutines and functions.
  • EXEC 2 has extra debugging facilities.
  • CMS programs can manipulate EXEC 2 variables.

Some statements of EXEC are not supported in EXEC 2, including:

  • &BEGSTACK ALL
  • &CONTROL
  • &EMSG
  • &END
  • &GOTO TOP
  • &HEX
  • &PUNCH
  • &SPACE
  • &TIME

Some predefined variables of EXEC are not defined in EXEC2:

  • &*
  • &$
  • &DISKX
  • &DISK*
  • &DISK?
  • &DOS
  • &EXEC
  • &GLOBAL
  • &GLOBALn
  • &READFLAG
  • &TYPEFLAG

02XEDIT Macros

XEDIT Macros are files with filetype XEDIT, whose contents are written using the syntax of CMS EXEC, EXEC 2 or REXX. Like regular EXEC 2 "EXEC" command files, they begin with a "&TRACE" statement, to distinguish them from CMS EXEC files.

03History

Written in the 1970s and formally introduced for CMS with VM/SP Release 1, EXEC 2 was preceded by CMS EXEC and superseded by REXX.

All three command interpreters, CMS EXEC, EXEC 2 and REXX, continue to be supported by z/VM.

Watch videos about EXEC 2Explainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article EXEC 2, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.