Copyright 1989-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 January, 1989 By Kevin G. Barkes Networks, Defaults, and Diesels Thanks to our involved readership, we're kicking off 1989 with a pair of useful utilities, a refresher course on English pronunciation and a unique method of referring to our favorite command language. Extended Capability K. L. Wickham of the RML/Radiochemistry Unit of Idaho National Engineering Laboratory in Idaho Falls, ID has provided a simple command file which demonstrates a straightforward method of executing DCL commands over a network link. RTMCMD.COM (Program 1) was developed to solve the limitations of the PRINT/REMOTE command when using printers on other nodes, and was then generalized to handle any command which a user would wish to have executed remotely. Mr. Wickham notes the command file must be present in the user's SYS$LOGIN directories on all nodes which will be using it. It also assumes that proxy logins have been set up so that a username and password do not have to be specified in the DCL command procedure. A typical example of its use for remote printing would be: $ COPY LETTER.TXT NETVAX::LETTER.TXT $ @RMTCMD NETVAX:: "PRINT/QUEUE=LASER/DELETE LETTER.TXT" "The DCL command procedure consists of two sections," Mr. Wickham explains, "a local section and a remote section, with a test at the top to determine which section is to be executed. "On the local node the procedure opens a file named "node::TASK=RMTCMD" which causes the command procedure to start executing on the remote node. The command to be executed is written across the network link and any reply is displayed on the terminal. "On the remote node the procedure opens a file with the logical name SYS$NET and reads the command into the symbol COMMAND. The logical SYS$OUTPUT is redefined to be the network link." he concludes, "and the contents of the symbol COMMAND are executed." A useful procedure, and a good example of using DCL over a network. ANOTHER SET DEFAULT? Regular readers of this column know I've sworn off "set default" utilities, and that I promised I wouldn't use any more for a long, long time. However, Jeff English of Texas Instruments in Plano, TX sent in a variation on the theme that is quite clever and, technically, isn't really a "set default" routine. DIRSYM.COM (Program 2) permits a user to quickly define global symbols for moving around to various directories. Once the symbols are defined, a user need only enter the symbol name to move to the specified directory. The symbol name is created from the name of the directory and can optionally be prefixed with a unique identifier, to handle situations in which identically-named subdirectories exist within other subdirectories, such as [user.source.test] and [user.exe.test]. "The idea for this procedure came from the task of constantly moving about my source directories," Jeff explains. "I have several project directories which contain the source for each project [and] each project has basically the same set of subdirectories (.INC, .PAS, .OBJ, etc.). My LOGIN.COM calls DIRSYM once for each project, passing a different prefix each time. I enter MPAS to move to the .PAS directory of project "Master", TPAS to move to the .PAS directory of project "Test", and so on." DIRSYM works by passing to it the pathname of the parent directory, a prefix, an optional NOECHO parameter to inhibit the display of symbols as they are assigned, and an optional command which can take the place of "SET DEFAULT". That's why this isn't merely another set default procedure. By changing the command defined for "SCmd" at the top of the file, other functions can be performed. For example, SCmd := "DEFINE 'DirSymbol' 'GoDirName'" will cause a logical to be defined equal to the pathname of each subdirectory. Our thanks to Mr. English for a unique approach to an old problem. YOU SAY TOMATO... Speaking of English (sorry, Jeff), our reference to the apparently inconsistent pronunciation of DEC and DECUS (that's "deck" and "dee kus") prompted a torrent of comment on my SYS$OUTPUT BBS as well as in the U.S. Mail. Kelvin Smith, Data Processing Manager of Financial Computer Systems in Stamford, CT explained it best: "... if the word has two syllables, the sound of the first vowel depends on whether it is followed by one or two consonants (or consonant clusters which are inseparable, such as "sh"). If there is only one consonant, it goes with the following syllable, and the first syllable is pronounced as if the whole word ended after the vowel, with a "long" vowel sound. Thus, DECUS is split up as DE-CUS, and pronounced DEE-KUS." Due to scheduling conflicts, I was unable to meet Kelvin last October at the DEE-KUS Symposium, or at DEX-PO ("note the two consonants," he points out; "the first belongs with the first syllable, the second with the last") to discuss the finer points of linguistic acrobatics. Oh well, it's all Latin to me... (lay-tin? Oops, better keep moving...) BY ANY OTHER NAME And speaking of fractured phonetics, I have a client who insists on pronouncing DCL (dee-see-ell) as "dee-sul" (as in "diesel"). "And why not?" he proclaims. "It's a syllable shorter, and DCL is a lot like a diesel engine: simple, powerful, slow, somewhat dirty but more than capable of getting the job done." I hope this fellow never discovers frame checking sequences in DECnet. ************ ---------- Kevin G. Barkes is an independent consultant. He publishes the KGB Report newsletter, operates the www.kgbreport.com website, lurks on comp.os.vms, and can be reached at kgbarkes@gmail.com. ************************************************************************ PROGRAM 1 $! RMTCMD.COM $! $ IF F$MODE() .EQS. "NETWORK" THEN GOTO REMOTE $ LOCAL: $ OPEN/READ/WRITE RMT$NET 'P1'"TASK=RMTCMD" $ WRITE RMT$NET P2 $ RDREPLY: $ READ/END_OF_FILE=CLSRMT RMT$NET RESULTS $ WRITE SYS$OUTPUT RESULTS $ GOTO RDREPLY $ REMOTE: $ OPEN/READ/WRITE RMT$NET SYS$NET $ READ/END_OF_FILE=NOCMD RMT$NET COMMAND $ IF COMMAND .EQS. "" THEN GOTO NOCMD $ DEFINE/USER SYS$OUTPUT RMT$NET $ 'COMMAND' $ GOTO CLSRMT $ NOCMD: $ WRITE RMS$NET "NO COMMAND RECEIVED - RMTCMD" $ CLSRMT: $ CLOSE RMT$NET $ EXIT $! $! Command procedure to execute commands on remote nodes. $! The command file must be present in the user's SYS$LOGIN directory $! on all nodes. $! Command form: $! @RMTCMD "NODE::" "COMMAND STRING" ******************************************************************** PROGRAM 2 $! DIRSYM.COM $! Comments at bottom of file. $ START: $ IF P4 .EQS. "" THEN ChgDir := SET DEFAULT $ IF P4 .NES. "" THEN ChgDir := 'P4 $! $ WS := WRITE SYS$OUTPUT $ FileExt := *.DIR $ SCmd := "'DirSymbol' == ChgDir + "" "" + GoDirName" $ IF P3 .EQS. "NOECHO" THEN GOTO GET_DIRECTORY $ WS "" $ WS "> > > Directory Symbol Generation < < <" $ GET_DIRECTORY: $ IF P1 .NES. "" THEN GOTO DIRINPUT $ WS "" $ WS "Type in the pathname of the directory to define the symbols" $ READ/PROMPT="-> " SYS$COMMAND DirName $ DirName = F$EDIT ( DirName, "TRIM, UPCASE" ) $ GOTO GET_PREFIX $ DIRINPUT: $ DirName = F$EDIT ( P1, "TRIM, UPCASE" ) $ GET_PREFIX: $ IF P2 .NES. "" THEN GOTO PFXINPUT $ WS "" $ WS "Type in the prefix for the symbols" $ READ/PROMPT="-> " SYS$COMMAND Prefix $ Prefix = F$EDIT ( Prefix, "TRIM, UPCASE" ) $ GOTO DO_COMMAND $ PFXINPUT: $ Prefix = F$EDIT ( P2, "TRIM, UPCASE" ) $ DO_COMMAND: $ FindString = DirName + FileExt $ LOOP: $! -- Locate each subdirectory within the specified directory $ Dirs = F$SEARCH ( FindString ) $ IF Dirs .EQS. "" THEN GOTO FINISHED $ SubDirName = F$ELEMENT ( 1, "]", Dirs ) $ SubDirName = F$ELEMENT ( 0, ".", SubDirName ) $ DirSymbol = Prefix + SubDirName $! -- Create path name to the subdirectory $ GoDirName = F$ELEMENT ( 0, "]", Dirs ) $ GoDirName = GoDirName + "." + SubDirName + "]" $! -- Execute the set symbol command for moving to the subdirectory $ 'SCmd' $ IF P3 .EQS. "NOECHO" THEN GOTO LOOP $ MsgLine := 'DirSymbol'" --> "'GoDirName' $ WS MsgLine $ GOTO LOOP $ FINISHED: $ EXIT $! Jeff English $! Software Design Engineer $! Texas Instruments $! PO Box 869305 MS 8408 $! Plano, TX 75086 $! FUNCTION: $! Define symbols which will automatically set the current $! directory. The symbols are created by prefixing all $! subdirectory names, within the specified directory, with the $! selected prefix. Entering the symbol will automatically $! set the current directory to that subdirectory. $! $! PARAMETERS: $! P1 = Pathname of directory to search for subdirectories $! P2 = Prefix to attach to the subdirectory names $! P3 = NOECHO if echoing of symbols is to be suppressed $! P4 = Alternate directory change command $! (Could be any other command) $! $! NOTES: $! (1) The default directory is the current directory $! (2) The default prefix is null $! (3) The default mode is to ECHO all symbols $! (4) The default command executed is "SET DEFAULT" $! (This command can be any command line statement)