Copyright 1991-2016 by Kevin G. Barkes All rights reserved. This article may be duplicated or redistributed provided no alterations of any kind are made to this file. This edition of DCL Dialogue is sponsored by Networking Dynamics, developers and marketers of productivity software for OpenVMS systems. Contact our website www.networkingdynamics.com to download free demos of our software and see how you will save time, money and raise productivity! Be sure to mention DCL Dialogue! DCL DIALOGUE Originally published April 1991 The Great DCL Debate By Kevin G. Barkes April seems to an appropriate month to look again at that burning question, "Is DCL A Programming Language?". I was recently taken to task by a reader who noticed my title here at the DEC Pro was changed from DCL Editor to VMS Editor. He accused me of forsaking DCL and my "defacto mantle as Protector of the DCL Language". The truth is much less sinister. I asked the powers that be for the title switch because VMS Editor is more representative of my function, since I do other things besides writing this column. Plus, I wanted to avoid the continuing embarassment of DEXPO security guards mistaking "DCL Editor" for "Diesel Editor" and informing me "the Truck Show and Tractor Pull isn't scheduled until next week". But the fellow was insistent, and demanded I make clear my position. I've managed to escape being pinned down on this one for so long I have most of the qualifications required to be elected to Congress. But the time has come to take a stand. Is DCL a programming language? Well, it's a matter of perspective. From the strictly lexicographic point of view, yes. Programming languages are used to produce programs. The dictionary defines a program as a sequence of instructions executed by a computer to produce a desired result. With the possible exception of AUTOGEN (sorry, cheap shot), DCL command files meet this requirement. Now we move to the strict VMS interpretation. Surprisingly, the VMS Glossary gives pretty much the same definition as the plain generic version listed above. But the glossary adds, almost as an afterthought, two deadly words: See image. A VMS image consists of "procedures and data bound together by the linker to form an executable program". DCL command procedures aren't compiled by the linker. They are executed by the DCL command interpreter, "a procedure-based system code that executes in supervisor mode in the context of a process to receive, to check the syntax of, and to parse commands entered by the user at a terminal or submitted in a command file." So it would seem that in order to be a "real" programming language under VMS, the language must have the ability to create object code that can be linked to produce an executable image file. V- italic Ok then, DCL is not a programming language, right? Not so fast, lexical breath. Buried in the VMS Glossary's definition of command procedure is the incriminating phrase "...permit users to employ such programming techniques as loops, counters, labels, and symbol substitution..." (programming techniques in italic) So, what's the deal? Remember, DCL is Digital Command Language. A command language is a source language which permits the execution of functions; in this case, DCL commands and lexicals. These command operations can be procedurally structured with control elements (IF - THEN - ELSE, GOTO, etc.) which allow the programmed execution of DCL commands. In other words, DCL is a command language with an unusually large number of robust procedural programming constructs which can be used to control the way in which the command interpreter executes DCL commands. More simply put: Can you program in DCL? Yes. Is DCL a programming language? Yes, again in the context of the conditional and procedural control of the execution of commands under the DCL command interpreter. Is a DCL command procedure a program? Yes, but in the context of the procedure running under the control of the command interpreter. No, but in the context of a program being an executable image under VMS. Frankly, the "great DCL debate" has never really been about DCL's status as a programming language. It's actually an issue dealing with the proper use of DCL. There's an old saying that "When your only tool is a hammer, most of your problems begin to resemble nails." Some people use DCL in ways its designers never intended. Remember, a command procedure is a set of instructions which supervises the execution of DCL commands. With very few exceptions, most DCL commands are acutally separate programs (that is, VMS .EXE files) that are run under the control of the command language interpreter. Every time you run a program under VMS, you use a respectable chunk of system resources to activate the image. You don't have to be a rocket scientist to figure out that a DCL command file which repetitively executes 10 or 20 images is going to put a bigger hit on the system than a single .EXE produced by a "real" programming language. On the other side of the coin, it often makes sense to perform some operations within DCL command files because of ease of maintenance, consistency of execution and similar considerations. But just as some people are DCLophiles, others are DCLophobes. I remember a programmer demonstrating with pride a program he had written in C to display the contents of a file. "Why not just use the TYPE command?" I asked. "Hmmph," he said. "TYPE.EXE is 61 blocks. Mine is 58." Is DCL a programming language? Depends on your point of view. Perhaps, to paraphrase David Letterman, it can best be said that "A DCL command procedure is not a program, but an incredible simulation!" Why do I get the sinking feeling I'm going to receive a torrent of "Top Ten Reasons To Program in DCL?" ********** After nearly five years of writing this column, I'm still astounded at my inability to predict accurately which articles will draw the biggest reader response. "Things They Never Told You About DCL", which appeared in the January issue, attracted more letters and e-mail dispatches than anything I've ever written, discounting a humor column in a local newspaper which advocated making the theme to the "Mr. Ed" television program the state song of Pennsylvania. (The final tally was 41-3 in favor. We're just waiting for the Legislature to act.) The preponderance of mail upheld my belief that a large number of users never received formal DCL training. Another respectable chunk pointed out several other commonly-overlooked tidbits of DCL arcana. Just as filename.ext;0 can be used to access the latest version of a file, filename.ext;-0 is a quick way to get to the lowest version. And the ;0 in the first example is optional; filename.ext; or filename.ext. work equally as well. Thanks to Gene Hoffman, Robert Coon, Eric Egnet and a host of others for taking the time to write. ************************************************* Kevin G. Barkes is an independent consultant and publisher of the KGB Report newsletter. He operates the www.kgbreport.com website, lurks on comp.os.vms and can be reached at kgbarkes@gmail.com.