Use of the terminal stack in a CMS machine running under VM/370
P J Gribbin · ITNOW · 1975
CMS (Conversational Monitor System) is an interactive operating system available to users of IBM’s VM/370 virtual machine operating system, providing a full command language for program development and testing. As is usual with systems of this kind, the command language incorporates a ‘command macro’ facility for users to invoke a whole file of commands with a single typein. These command macros are called EXEC PROCEDURES, and are invoked by entering the name of the exec procedure, along with variable control data as necessary. This paper describes a technique that allows exec procedures to extract data from CMS files: and to communicate between themselves in a more powerful manner than is allowed by the use of global variables. Exec procedures are capable of invoking all CMS commands and, additionally, of manipulating small strings of data generated internally or read from the terminal, thereby allowing substitution of file names, control of loops, validity checking and so forth. This capability allows the user to develop extremely powerful exec procedures and it was frustrating to discover that, with all the power available, one could neither extract control information from a disc file nor pass other than numeric values between exec procedures. This led to a ridiculous situation where information was being displayed on the terminal, using the CMS TYPE command (which displays all or part of the specified file), followed by a request to enter the information into the exec procedure! We were at this time well aware of the exec procedure &STACK command, which allows one to stack information into the terminal buffer for subsequent input to a CMS command that requires terminal input (such as the SORT command); we were equally aware of the &READ which allows the exec procedure to read data from the console. It took us rather longer, however, to realise that exec procedures could communicate via the stack.