Copyright 1994-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 October, 1994 Getting the Goods By Kevin G. Barkes (update: my current favorite source of links to VMS stuff is http://www.levitte.org/~ava) Unlike MS-DOS software, which is available from virtually all BBS systems and online providers (like CompuServe), OpenVMS VAX and AXP programs can be a bit harder to root out in cyberspace. Fortunately, if you have a plain vanilla e-mail account on a system that can reach the Internet, you can access a wealth of goodies. There are a number of sites with VMS stuff, but my favorite is WKUVX1.WKU.EDU, a friendly little repository at Western Kentucky University looked after by Hunter Goatley, VMS Systems Programmer and Swell Fella. To find out what's available, send the following command in the body of a mail message to fileserv@wkuvx1.wku.edu: DIR ALL This returns a brief listing of all the packages available from the site. In order to transmit binary files via email, fileservers use software to convert the executables into plain ascii text. At the receiver's site, complementary programs transmogrify the files into their original binary forms. The first time you request a file from the server, you'll probably need to include the line SEND FILESERV_TOOLS in order to receive the utilities needed to get you up and running. A couple suggestions: Start modestly. Request a small file and familiarize yourself with the tools. Don't be a pig; only take one or two files at a time. Making a fileserver throw up the entirety of its innards at one fell swoop can swamp the server, your net connections and your local site. By the time you get around to putting everything together, new versions of software may be available. Finally, support the folks who support you. If your tuchas has been saved by a piece of code you snatched off the net, show your gratitude by offering a token payment to the author of the code and/or the maintainer of the system. There ain't no such thing as a free fileserver. It costs money to keep systems running, and unsolicited contributions can help provide the necessary motivation. ********** MAKE.ENEMIES.FAST. A friend of mine has been having a dickens of a time with his Internet mail account, all because his parents made the mistake of giving him the name David Rhodes. "The" David Rhodes, of course, is the author of the infamous chain letter scheme that spams Usenet from time to time. As for my buddy, he solved his problem by calling referring to himself as D. Leroy Rhodes. ********** MORE QUEUE STUFF. Lots of you liked Carl Wheeler's batch queue stopper in the August issue and asked for more of the same. Blake Williford of Fuller went a step further and passed along DJQ.COM (Program 1) and DPQ.COM (Program 2), procedures which make monitoring your batch and job queues a snap. Examining the code reveals some tricks and unusual methods of formatting display output. ********** TIME TRACKER. It's quick, it's dirty, but it covers the basics. (Program 3.) "This procedure is a simple version", submitter Dan Cranmer explains, "such that it just reports a single time delta, no tagging, only 24 hours and doesn't handle day cross over. I define the symbol $TIMER == "@UTILS:TIMER.COM" in my LOGIN.COM so all I have to type is $TIMER to get the time since it was last called." ********** OOPS. Lots of people, including Tommy Noble, wrote to correct my comment about the $ENTRY symbol in the July column. $ENTRY is a local symbol, of course, not global. ********** Kevin G. Barkes is an independent consultant who plans to observe Halloween by dressing up as a lexical function. Kevin lurks on comp.os.vms and can be reached at kgbarkes@gmail.com. PROGRAM 1: $! DJQ.COM $! Display Job Queue $! This command procedure shows all queues and the jobs in them. $! $ SET TERM/WIDTH = 132 $ ON control_y THEN GOTO EXIT_TIME $ ESC[0,32]=%x1B ! Escape Code $ DH1[0,24]=%x33231B ! Double Height Line One Code $ DH2[0,24]=%x34231B ! Double Height Line Two Code $ DW[0,24]=%x36231B ! Double Width Code $ HI[0,32]=%x6D315B1B ! High Intensity Code $ ER[0,32]=%x4A325B1B ! Erase Screen Code $ RV[0,32]=%x6D375B1B ! Reverse Code $ BL[0,32]=%x6D355B1B ! Blink Code $ Uon[0,32]=%x6D345B1B ! Underline mode on $ AO[0,24]=%x6D5B1B ! Attributes Off Code $ Tab[0,32]=%x09 ! Tab $ CP = ESC+"[0;02H" ! Clear Page $ CED= ESC+"[?0J" ! Clear from cursor to end of page $ SAY = "WRITE SYS$OUTPUT" $ TITLE1 = "Current Batch Jobs" $ DJ = "DISPLAY_JOB" $ FC = "FREEZE_CONTEXT,ALL_JOBS" $ RL = " !19AS!_!10AS!_!24AS !24AS!_!25AS !5AS" $! $ SAY ER,CP $ TOP: $ SAY CP $ SAY DH1, TAB, TAB, TITLE1 $ SAY DH2, TAB, TAB, TITLE1 $ Say f$fao("!4AS!4AS!4AS!7AS!109* !%T", - RV,"[f6]",AO,"to exit",0 ) $ Say HI, - f$fao(rl,"Job Name","Account","Submission time", - "Run time","Status","Entry"),AO $ TEMP = F$GETQUI("") $ QLOOP: $ QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*","EXECUTING_JOBS,BATCH") $ IF QNAME .EQS. "" THEN GOTO PAUSE_S $ CLOOP: $ SAY Uon, F$FAO("!15AS",QNAME), AO, F$FAO("!117* ") $ JLOOP: $ NOACCESS = F$GETQUI(DJ,"JOB_INACCESSIBLE",,"ALL_JOBS") $ IF NOACCESS .EQS. "TRUE" THEN GOTO JLOOP $ IF NOACCESS .EQS. "" THEN GOTO QLOOP $ JNAME = F$GETQUI(DJ,"JOB_NAME",,FC) $ JOWNER= F$GETQUI(DJ,"ACCOUNT_NAME",,FC) $ JUSER = F$GETQUI(DJ,"USERNAME",,FC) $ JSUBM = F$GETQUI(DJ,"SUBMISSION_TIME",,FC) $ JRUNT = F$GETQUI(DJ,"AFTER_TIME",,FC) $ JENTRY= F$STRING( F$GETQUI(DJ,"ENTRY_NUMBER",,FC) ) $ JSTAT = "" $ IF F$GETQUI(DJ,"JOB_HOLDING",,FC) THEN JSTAT = JSTAT + "Holding " $ IF F$GETQUI(DJ,"JOB_SUSPENDED",,FC) THEN JSTAT= JSTAT + "Suspended " $ IF F$GETQUI(DJ,"JOB_TIMED_RELEASE",,FC) THEN JSTAT=JSTAT+"T-Rel " $ IF F$GETQUI(DJ,"JOB_STARTING",,FC) THEN JSTAT = JSTAT + "Starting " $ IF F$GETQUI(DJ,"JOB_RETAINED",,FC) THEN JSTAT = JSTAT + "Retained " $ IF F$GETQUI(DJ,"JOB_RESTART",,FC) THEN JSTAT = JSTAT + "Restart " $ IF F$GETQUI(DJ,"JOB_REFUSED",,FC) THEN JSTAT = JSTAT + "Refused " $ IF F$GETQUI(DJ,"JOB_PENDING",,FC) THEN JSTAT = JSTAT + "Pending " $ IF F$GETQUI(DJ,"JOB_EXECUTING",,FC) THEN JSTAT = JSTAT + "Executing " $ IF F$GETQUI(DJ,"JOB_ABORTING",,FC) THEN JSTAT = JSTAT + "Aborting " $ SAY f$fao(rl, JNAME, JUSER, JSUBM, JRUNT, JSTAT, JENTRY ) $ GOTO JLOOP $ PAUSE_S: $! SAY f$fao("!132* ") $! SAY f$fao("!132* ") $ say ced $ WAIT 00:00:03 $ GOTO TOP $! $ EXIT_TIME: $ SAY ER,CP $ SET TERM/WIDTH = 80 $ EXIT PROGRAM 2: $! DPQ.COM $! Display Print Queue $! This command procedure shows all print queues and the jobs in them. $! $ ON control_y THEN GOTO EXIT_TIME $ ESC[0,32]=%x1B ! Escape Code $ ER[0,32]=%x4A325B1B ! Erase Screen Code $ RV[0,32]=%x6D375B1B ! Reverse Code $ Uon[0,32]=%x6D345B1B ! Underline mode on $ AO[0,24]=%x6D5B1B ! Attributes Off Code $ CP = ESC+"[0;02H" ! Clear page $ CEP= ESC+"[?0J" ! Clear to end of page $ SAY = "WRITE SYS$OUTPUT" $ DJ = "DISPLAY_JOB" $ FC = "FREEZE_CONTEXT,ALL_JOBS" $ rl = " !15AS !15AS !5ASK !11AS !14AS !5AS !6AS" $ tl = "!15AS!65* " $! $ SAY ER,CP $ TOP: $ SAY cp,F$FAO("!4AS!4AS!4AS!7AS!56* !%T", RV,"[f6]",AO,"to exit", 0 ) $ LINE = F$FAO(rl,"Job name","Account","Size", - "Form","Status","Entry","S Time", AO) $ SAY Uon, Line, AO $ TEMP = F$GETQUI("") $ QLOOP: $ QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*","PRINTER,TERMINAL") $ IF QNAME .EQS. "" THEN GOTO PAUSE_S $ CLOOP: $ SAY f$fao(tl,QNAME) $ JLOOP: $ NOACCESS = F$GETQUI(DJ,"JOB_INACCESSIBLE",,"ALL_JOBS") $ IF NOACCESS .EQS. "TRUE" THEN GOTO JLOOP $ IF NOACCESS .EQS. "" THEN GOTO QLOOP $ JNAME = F$GETQUI(DJ,"JOB_NAME",,FC) $ JUSER = F$GETQUI(DJ,"USERNAME",,FC) $ JSIZE = F$GETQUI(DJ,"JOB_SIZE",,FC) $ JFORM = F$GETQUI(DJ,"FORM_STOCK",,FC) $ JSUM = f$extract(12,5, F$GETQUI(DJ,"SUBMISSION_TIME",,FC) ) $ JDONE = F$GETQUI(DJ,"COMPLETED_BLOCKS",,FC) $ JSIZES= F$STRING( (f$getqui(dj,"JOB_SIZE",,FC)-JDONE ) * 512 ) $ JENS = f$string( F$GETQUI(DJ,"ENTRY_NUMBER",,FC) ) $ JSTAT = "" $ IF F$GETQUI(DJ,"JOB_HOLDING",,FC) THEN JSTAT ="Holding " $ IF F$GETQUI(DJ,"JOB_SUSPENDED",,FC) THEN JSTAT="Suspended " $ IF F$GETQUI(DJ,"JOB_TIMED_RELEASE",,FC) THEN JSTAT ="T-Release " $ IF F$GETQUI(DJ,"JOB_STARTING",,FC) THEN JSTAT ="Starting " $ IF F$GETQUI(DJ,"JOB_RETAINED",,FC) THEN JSTAT ="Retained " $ IF F$GETQUI(DJ,"JOB_RESTART",,FC) THEN JSTAT ="Restart " $ IF F$GETQUI(DJ,"JOB_REFUSED",,FC) THEN JSTAT ="Refused " $ IF F$GETQUI(DJ,"JOB_PENDING",,FC) THEN JSTAT ="Pending " $ IF F$GETQUI(DJ,"JOB_EXECUTING",,FC) THEN JSTAT ="Printing " $ IF F$GETQUI(DJ,"JOB_ABORTING",,FC) THEN JSTAT ="Aborting " $ line = f$fao(rl,JNAME,JUSER,JSIZES,JFORM,JSTAT,JENS,JSUM ) $ SAY line $ GOTO JLOOP $ PAUSE_S: $ say cep $ WAIT 00:00:03 $ GOTO TOP $! $ EXIT_TIME: $ SAY ER,CP $ EXIT PROGRAM 3: $ vfy=f$verify(0) $! TIMER.COM Dan Cranmer July 20, 1994 $! This procedure stores the current time and reports the delta $! when it is called subsequent times. $ $ if "''t1'" .eq. "" $ then $ t1 == f$cvtime(,,"hour")*3600+f$cvtime(,,"minute")*60+f$cvtime(,,"second") $ else $ t2 = f$cvtime(,,"hour")*3600+f$cvtime(,,"minute")*60+f$cvtime(,,"second") $ delta = t2 - t1 $ hr = delta / 3600 $ min = (delta - hr * 3600) / 60 $ sec = delta - (hr * 3600 + min * 60) $ write sys$output f$fao("timer !2ZL:!2ZL:!2ZL", hr, min, sec) $ t1 == t2 $ endif $ vfy = f$verify(vfy) !Restore the saved verify state