Copyright 1992-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 February, 1992 Stupid DCL Tricks Revisited By Kevin G. Barkes As a rule, I try to separate "Stupid DCL" columns by at least four months or so. That the topic reappears so soon after the last installment (December, 1991) can be blamed on the recent traumatic move my family made to a new house. I won't talk about how hard it is for a self-employed independent consultant to get a mortgage these days. (Where's Neil Bush when you need him?) I also won't bring up the fact it cost 50% more to have my eight phone lines installed than it did to have a moving company transfer the equivalent of ten rooms of furnishings to our new location. I won't bore you with the details of how the telephone company managed to effectively short out all of the phones in the neighborhood for two days while doing the installation, or how they destroyed my next door neighbor's 15-year-old rhododendron bush while putting in the new underground cable. Nothing like memorable first impressions... And I won't even consider begging for your sympathy by noting all of my DCL files and documentation are buried somewhere in the midst of 50 sealed cartons in the garage. Instead, I will maintain my normally cheerful demeanor and plunge ahead with another thrilling chapter of Stupid DCL Tricks, or Things Which Come To Mind After Dropping A 19" Monochrome Monitor On One's Bare Feet. *************************** A frequently overlooked feature of the DCL RENAME command is its ability to move directory trees to new locations on the same disk. Say you have a whole mess of files in a subdirectory like [JONES.TEST.FEBRUARY.DCL]. You want to move the entire .TEST subdirectory to a separate directory on the drive. Instead of creating the new directories, copying the files there, and deleting the originals, you can simply issue the command: $ RENAME [JONES]TEST.DIR DISK:[000000]TEST.DIR The new directory, [TEST], will contain the [.FEBRUARY] and [.DCL] subdirectories and all of their files. Of course, make certain you don't attempt to create a new directory where one with the same name already exists. *************************** Ever wonder what files are being accessed by that command file or program you're running? An undocumented DCL command, SET WATCH, can provide you with an extraordinary amount of information about your process' file system operations. To see if you can use the command, check that SYS$SYSTEM:SETWATCH.EXE exists on your system. You also need CMEXEC (change mode to executive) privilege, or you'll have to ask your system manager to install the image with the privilege, if your site's security requirements permit it. The command form is: $ SET WATCH FILE/CLASS=(classname) The more interesting class names include: ALL (self-explanatory) ATTRIBUTES (show file attribute modifications) CONTROL_FUNCTION (show protection changes) DIRECTORY_OPERATIONS (show all directory accesses) DUMP (dump file information block) MAJOR_FUNCTION (file reads, writes, opens, closes) NONE (use to disable SET WATCH) QUOTA_OPERATIONS (Disk quota changes) If I enter $ SET WATCH FILE/CLASS=DIRECTORY then issue the command: $ DIR the system will display: %XQP-I-FUNCTION, Directory scan for: BARKES.DIR;1, Status: 00000001 %XQP-I-FUNCTION, Read only directory access (13,1,0) %XQP-I-FUNCTION, Directory scan for: PROPRESS.DIR;1, Status: 00000001 %XQP-I-FUNCTION, Read only directory access (66,8,0) %XQP-I-FUNCTION, Directory scan for: DCL92.DIR;1, Status: 00000001 Directory USER2:[BARKES.PROPRESS.DCL92] BARKES.FEB92;1 BARKES.JAN92;3 BARKES.TJL;1 Total of 3 files. The SET WATCH function is turned off by entering: $ SET WATCH FILE/CLASS=NONE *************************** You may ask, where does one find all these nifty undocumented commands? Joe Meadows, Jr. freely distributes a program he wrote, VERB, which extracts DCL command definitions from your process space or a command table file, such as SYS$SHARE:DCLTABLES.EXE. By comparing the output of VERB to the official DEC documentation, you can pinpoint commands "hidden" within DCL. VERB uncovered the following on SET WATCH: define syntax SET_WATCH image SETWATCH parameter P1, label=OPTION value (required) parameter P2, label=WATCH_OPTION, prompt="What" value (required,type=WATCH_OPTIONS) qualifier CLASS value (required,list,type=WATCH_CLASSES) disallow not CLASS define type WATCH_OPTIONS keyword FILE define type WATCH_CLASSES keyword ALL, negatable keyword ATTRIBUTES, negatable keyword CONTROL_FUNCTION, negatable keyword DIRECTORY_OPERATIONS, negatable keyword DUMP, negatable keyword ATTACHED, negatable keyword MAJOR_FUNCTION, negatable keyword NONE keyword QUOTA_OPERATIONS, negatable VERB was used to uncover the /FOREIGN qualifier to the MAIL utility mentioned here last year. It also reveals such goodies as the CHECKSUM command and the /ANALYZE qualifier to backup. *************************** Kevin G. Barkes is an independent consultant who sometimes finds the documented DCL commands more than sufficiently puzzling. He can be found lurking on comp.os.vms or reached at kgbarkes@gmail.com.