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 March, 1992 Defensive DCL By Kevin G. Barkes While VMS is a particularly robust operating system and DCL an unusually friendly command language, nothing is perfect. With every new release of VMS, some bugs are fixed. Unfortunately, others are created. New release problems are, for the most part, easily identifiable and surface quickly. But some nasties lie hidden for years, only to be discovered by accident when someone enters a unique command string under equally unique conditions on a uniquely configured VAX. Now, I'm not paranoid (and stop thinking that I am). Still, I find myself worrying about weird things that happen from time to time in my DCL code. Stuff that I can't seem to duplicate and that I generally attribute to keyboard error or too much time in front of the terminal. Where to learn of these potential disasters in waiting? I've found that one of the best places to pick up on new problems or newly-discovered old problems is via DSNlink, DEC's on-demand electronic customer support network. If you're paying for VMS software support, you can hook up to DSNlink at no additional charge. A full description of the service can be found in the November 1990 DCL Dialogue (DSNlink: On-Demand Software Support). If you're paying for software support and haven't hooked up to DSNlink, you're wasting a major portion of your support dollars. All you need is a phone line, a port on your VAX and a modem. DSNlink calls are made on an 800 number, so Digital picks up the tab. While DEC insists these items must be entirely dedicated to DSNlink, in reality many sites have written automated procedures to "turn off" DSNlink when the line is needed for other purposes. Control is returned to DSNlink when the secondary requirements have been completed. DEC requests a dedicated link so that it can deliver "FLASHMAIL" messages, urgent communiques on software problems. In reality, most sites get on average one FLASHMAIL every month and a half at best, so temporarily using the port for another use doesn't really pose a major problem. Aside from being a wonderful source for software patches, DSNlink is the best place to learn of newly-discovered weirdness in VMS and DCL. Once or twice a month I link up and look at the latest problems users have reported. My mid-December check revealed some real goodies: o The behavior of the PURGE command changed in 5.4-1. Under earlier versions of VMS, a wildcard subdirectory purge would start at the specified top level directory and work downward. If PURGE encountered a file for which it lacked delete privilege, it would report the error and keep on going. The new PURGE behavior is decidedly different. It looks at the subdirectories prior to executing and immediately aborts if it encounters any file access privilege errors. A decided change in behavior, and it explains something I thought was a delusion on my part. o Command files SUBMITted to batch queues are opened by their file ids. But VMS uses the file name, not the file id, to delete files queued with SUBMIT/DELETE. So, while renaming a file won't prevent it from being opened for execution by the queue manager, it could prevent it from being deleted. o Due to the design of DECnet, files copied over a network could end up with their dates in the wrong century. DECnet only looks at the last two digits in the year field. If those digits are between 00 and 69, (that is, the file is dated prior to 1970) DECnet sticks a "20" to the front of the date field, effectively shifting the file on the destination cpu into the next century. Talk about your temporal displacement... Another great thing about DSNlink is on-line documentation, a real boon for people who don't have access to the real doc. Or folks like me, who recently moved and can't find the boxes where the movers stashed my Big Grey Wall. ********************** PURGING VARIATIONS Back in the December 1991 column I published a reader-submitted command procedure called PURGE_MIDDLE.COM which, appropriately enough, purged the middle versions of a file, retaining the newest and oldest versions. Seemingly minutes after the issue hit the street I was inundated with mail, electronic and otherwise, offering numerous improvements to the original. Thanks to John Reagan, Kent Brodie of the Medical College of Wisconsin, Mark Jaeger of the University of Chicago, Scott Brown of Mitel Corporation and Richard Black of the USAA, among others, who suggested alternative approaches requiring less code. My personal favorite is Mr. Black's, which appears as Program 1. If you have some spiffy code you'd like to share (and have critiqued by thousands of DCL afficiandos), pass it on to me at the address below. By the way, Internet users can send electronic mail to my CompuServe account via the address 72067.341@compuserve.com. Unfortunately, the local gateway to my FidoNet board isn't completely reliable, so you're better off directing your missives to CompuServe. Also, don't be surprised if you don't get an immediate response to your mail. You'll receive an acknowledgment eventually, either here in the magazine or through whatever media is handy. And speaking of mail, my recent move to a new house has resulted in unfortunate delays for some folks wanting DCL stickers or tapes of files on the BBS. In one instance, a letter addressed to my old residence took two weeks to show up at the new place. What makes this particularly perplexing is that the two houses are only 1.2 miles apart and serviced by the same post office. I guess Louis Rukeyser was right... 20 cents of every 29 cent stamp goes toward storage. And if I may abuse my position a bit... hey, DEC! I've sent out over 20 change of address notices to you guys, and I'm still getting stuff at the old place. I wonder if they ever run merge/purges on their mailing lists... ****************************** Kevin G. Barkes is an independent consultant who enjoys receiving comments and criticisms from readers. He can be found lurking on comp.os.vms or reached at kgbarkes@gmail.com. ************************** PROGRAM 1: $! Deletes all but the highest and lowest version $! of a file. $! $ FILE = F$PARSE(P1,,,"NAME")+F$PARSE(P1,,,"TYPE") $ FILE_HIGH = F$SEARCH(FILE+";0") $ FILE_LOW = F$SEARCH(FILE+"-0") $ DELETE/EXCLUDE=('FILE_HIGH','FILE_LOW') 'FILE';*