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&variable =
*Control statements. A statement where the first data item is an ''EXEC control word'' and the second is not an equals sign 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.
**&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 * REXXReferences
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)