CMS EXEC, or EXEC, is an interpreted, command procedure control, computer
scripting language
A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.
A scripting ...
used by the CMS EXEC Processor supplied with the
IBM Virtual Machine
In computing, a virtual machine (VM) is the virtualization/emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hardw ...
/
Conversational Monitor System
The Conversational Monitor System (CMS – originally: "Cambridge Monitor System") is a simple interactive computing, interactive single-user operating system. CMS was originally developed as part of IBM's CP/CMS operating system, which went ...
(
VM/CMS
VM (often: VM/CMS) is a family of IBM virtual machine operating systems used on IBM mainframes System/370, System/390, zSeries, System z and compatible systems, including the Hercules emulator for personal computers.
The following versions ...
) operating system.
EXEC was written in 1966 by
Stuart Madnick at MIT on the model of
CTSS RUNCOM
RUNCOM is a CTSS macro command (script) processor.
History
Louis Pouzin created RUNCOM for CTSS circa 1963. He wrote a paper in 1965 describing a design for the Multics shell which includes a brief description of RUNCOM followed by a second p ...
. He originally called this processor COMMAND, and it was later renamed EXEC.
CMS EXEC has been superseded by
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.
Relation to EXEC
EXEC 2 ...
and
REXX. All three — CMS EXEC,
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.
Relation to EXEC
EXEC 2 ...
and
REXX — continue to be supported by the
IBM CMS product.
The EXEC language
*EXEC processes lines up to 130 characters long when entered from a terminal, or 72 characters when read from a file.
*A ''label'' consisting of a
dash
The dash is a punctuation mark consisting of a long horizontal line. It is similar in appearance to the hyphen but is longer and sometimes higher from the baseline. The most common versions are the endash , generally longer than the hyphen b ...
followed by up to seven
alphanumeric
Alphanumericals or alphanumeric characters are a combination of alphabetical and numerical characters. More specifically, they are the collection of Latin letters and Arabic digits. An alphanumeric code is an identifier made of alphanumeric c ...
characters can prefix a CMS command or an EXEC control statement.
*The interpreter parses commands into blank-delimited ''
tokens'' of up to eight characters each.
*Variables consist of an
ampersand followed by up to seven alphanumeric characters. Variables can be either user-defined variables or pre-defined ("special") EXEC variables.
*As each line is read the tokens are scanned. If they contain EXEC variables the variables are replaced by their value.
*Comments. Comments in EXEC files begin with an
asterisk in column one. All other statements are executable statements.
*Null statements. A null statement contains no data items.
*CMS commands. If the first data item on a line is not an asterisk or ampersand the EXEC processor considers the line to be a CMS command and passes it to CMS for immediate execution.
*Assignment statements. An assignment statement assigns a value to an EXEC variable. It has the form
&variable =
*Control statements. A statement where the first data item is an ''EXEC control word'' and the second is not an
equals sign
The equals sign (British English, Unicode) or equal sign (American English), also known as the equality sign, is the mathematical symbol , which is used to indicate equality in some well-defined sense. In an equation, it is placed between two ...
is assumed to be a control statement.
*EXEC control words:
**&ARGS - allows the user to redefine command arguments.
**&BEGPUNCH - heads a series of lines to be spooled to the user's virtual punch.
**&BEGSTACK - heads a series of lines to be placed in the user's console input stack.
**&BEGTYPE - heads a series of lines to be typed on the user's terminal.
**&END - marks the end of the lines processed by &BEGPUNCH, &BEGSTACK, or &BEGTYPE.
**&CONTINUE - tells the interpreter to process the next line in the file.
**&CONTROL - controls the format in which messages are displayed.
**&ERROR - tells the interpreter what to do if an error is detected.
**&EXIT - exits the current EXEC file, and optionally sets a return code.
**&GOTO - branches to another location in the current EXEC file. The location can be TOP for the beginning of the file, a label, or a line number.
**&IF allows for conditional execution of statements.
**&LOOP - heads a group of statements to be executed multiple times, or until a specified condition is true.
**&PUNCH - sends a string of tokens to the user's virtual punch. Each &PUNCH statement generates one card-image, padded or truncated if necessary.
**&READ - reads one or more lines from the user's
terminal
Terminal may refer to:
Computing Hardware
* Terminal (electronics), a device for joining electrical circuits together
* Terminal (telecommunication), a device communicating over a line
* Computer terminal, a set of primary input and output dev ...
.
**&SKIP - skips (ignores) a specified number of lines.
**&SPACE - types a specified number of blank lines on the user's terminal.
**&STACK - places one line in the user's input stack. The line is constructed from tokens as for &PUNCH.
**&TIME - specifies what timing information is to be typed on the user's terminal following the execution of each CMS command.
**&TYPE types a line on the user's terminal. The line is constructed from tokens as for &PUNCH.
*Built-in functions. The EXEC interpreter provides a few "built-in" or predefined functions:
**&CONCAT concatenates a string of tokens.
**&DATATYPE examines a token and determines whether it is numeric or alphabetic.
**&LENGTH returns the length of a token.
**&LITERAL prevents variable substitution within a token.
**&SUBSTR extract selected characters from a token.
Sample code
''PROFILE EXEC'' is an EXEC that is automatically executed when a user logs on to tailor their environment. A simple PROFILE EXEC might look like the following:
* The following code issues CMS commands to set
* the "blip" character to asterisk and request
* the "short" format for system ready messages.
&CONTROL OFF
SET BLIP *
SET RDYMSG SMSG
Related CMS Command Procedure Control Languages
* CMS EXEC
*
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.
Relation to EXEC
EXEC 2 ...
*
REXX
References
External links
*
*
*{{cite book, url=http://www.bitsavers.org/pdf/ibm/370/vm370/GC20-1812-1_VM370exec_Apr75.pdf, title=IBM Virtual Machine Facility/370: EXEC User's Guide, id=IBM publication number GC20-1812-1, edition=2nd, date=April 1975, access-date=2012-03-14, archive-url=https://web.archive.org/web/20110814143648/http://www.bitsavers.org/pdf/ibm/370/vm370/GC20-1812-1_VM370exec_Apr75.pdf, archive-date=2011-08-14, url-status=dead
IBM mainframe operating systems
Scripting languages
VM (operating system)