Writing Real Programs in DCL, Second Edition

THIS CHAPTER PRESENTS VARIOUS TECHNIQUES and tricks for manipulating data in DCL. The techniques include methods for performing simple arithmetic operations, character string manipulation, and calculations related to dates and times.
DCL provides only rudimentary arithmetic operations on integer values. Applications often require more sophisticated operations, which must be built up out of the operations that DCL provides. This section illustrates a few of the advanced operations and how they can be achieved in DCL.
The "maximum" function examines two or more integers and returns the largest one. The "minimum" function is similar but returns the smallest integer. These functions are not provided by DCL but can be implemented as follows:
$! Determine the largest of the values A, B, and C. $ $ max = a $ if b .gt. max then max = b $ if c .gt. max then max = c
-or-
$! The block count is equal to the total file blocks, $! but can be no larger than 600. In other words, $! block_count = minimum(total-file-blocks, 600). $ $ block_count = total_file_blocks $ if block_count .gt. 600 then block_count = 600
Sometimes it is...