Writing Real Programs in DCL, Second Edition

THE PREVIOUS CHAPTER PRESENTED SYMBOLS and expressions, the tools DCL provides for creating and manipulating data. Without some means for making decisions about data, however, there is not much a procedure can do with data other than display it. This chapter presents DCL commands that allow a procedure to make decisions and take different actions based on those decisions. These commands are called flow-of-control commands because they are used to control and alter the flow of execution through the procedure. Each time the procedure is run, DCL can execute distinct portions of the procedure based on data obtained or calculated by it.
When you run a DCL procedure with the at-sign ( @) command, DCL executes the commands in the procedure one at a time, in order, from top to bottom. This is called sequential execution of commands. Simple procedures can be written using only sequential execution:
$! A procedure named SIMPLE-PROC $ $ show time $ directory $ show users
This procedure first displays the current date and time. It then displays a listing of the files in the working directory. Finally it displays a list of the users logged in to the system.
In order to run this procedure, you use the at-sign command. The name of the procedure file is specified following the at-sign, and DCL runs the...