N~ AEFNOTIFY.BCKn AEFNOTIFY.BCKxBACKUP/INTERCHANGE FT$DISK:[FELDMAN.NOTIFY.RELEASE]NOTIFY.COM;,FREEWARE_README.TXT;,RELEASE-FORM.TXT; AEFNOTIFY.BCK/SAVE FELDMAN H(/V6.1 _IDS03::  _IDS03$DKA200: V6.1 ~ 9$*[FELDMAN.NOTIFY.RELEASE]NOTIFY.COM;1+,0./H( 4|f-^0123KPWO56t{7Ҭu/89GH(HJB$!+ NOTIFY.COM : Author: Alan E. Feldman afeldman@gfigroup.com$! @$! PURPOSE: To notify the user when a batch or print job has A$! terminated. This is useful for jobs that are running either .$! with /NONOTIFY or under another username.$! 9$! Suggested usage: $ DONE :== @disk:[dir]NOTIFY.COM$!.$! $ DONE $!H$! You must have a queue that is available for jobs. It is recommendedD$! that you set up a dedicated queue, use /BASE_PRIORITY=(4 or 5),<$! make sure the job limit is reasonably high, and be sure2$! to set NOTIFY_QUEUE below to the queue name. $$!! User settings:$$ MAIL_NOTIFICATION = 0$ REPLY_NOTIFICATION = 1$ NOTIFY_QUEUE := SYS$BATCH G$ NOTIFY_QUALIFIER = "NONOTIFY" ! (Change to "NOTIFY" *only* if youA$! ! are debugging NOTIFY.COM.)$$!! End of user settings.$H$!======================================================================$!"$!! Initialize important symbols:$$ READ = "READ"$ WRITE = "WRITE"$ WSO := WRITE SYS$OUTPUT$ DELETE = "DELETE"$ REPLY = "REPLY"$ MAIL = "MAIL"$ SET = "SET"$ ON = "ON"$%$!! Define some simple status codes:$ $ NOTIFY__STATUS = %X18018000.$ NOTIFY__SUCCESS = NOTIFY__STATUS + %X0001)$ NOTIFY__CY = NOTIFY__STATUS + %X000C$0$!! Establish the interrupt and error handlers:$$ STATUS = NOTIFY__SUCCESS&$ ON CONTROL_Y THEN GOTO _CONTROL_Y $ ON WARNING THEN GOTO _ERROR$?$ IF (.NOT.MAIL_NOTIFICATION .AND. .NOT.REPLY_NOTIFICATION) $ THEN$ WSO " " W$ WSO "%NOTIFY-F-NOMETHODTRUE, must have at least one notification symbol true."P$ WSO "Edit NOTIFY.COM and change at least one notification symbol to 1."*$ STATUS = NOTIFY__STATUS + %o00024$ GOTO _EXIT $ ENDIF$&$!! Check if user has OPER privilege:$%$ SET NOCONTROL=Y %$ SAVED_OPER = F$SETPRV("OPER") %$ HAVE_OPER = F$PRIVILEGE("OPER") %$ JUNK = F$SETPRV(SAVED_OPER) &$ ON CONTROL_Y THEN GOTO _CONTROL_Y$ SET CONTROL=Y $1$ IF (.NOT.HAVE_OPER .AND. REPLY_NOTIFICATION) $ THEN$ WSO " "Q$ WSO "%NOTIFY-W-NOOPER, must have OPER privilege for REPLY notification."$ MAIL_NOTIFICATION = 1>$ WSO "%NOTIFY-I-WILUSEMAIL, will notify you via MAIL."L$ WSO "%NOTIFY-I-CHGSYMVALU, Edit NOTIFY.COM and change the value of P$ WSO "the symbol REPLY_NOTIFICATION to 0 (FALSE) to avoid this message." $ ENDIF$($!! Run appropriate part based on mode:$!$ PART = "_" + F$MODE()$ GOTO 'PART'$!$_INTERACTIVE:$!+$ PROCEDURE = F$ENVIRONMENT("PROCEDURE")$ PROCEDURE_LOCATION -I = F$PARSE(PROCEDURE,,,"DEVICE") + F$PARSE(PROCEDURE,,,"DIRECTORY")B$ LATEST_PROCEDURE = PROCEDURE - F$PARSE(PROCEDURE,,,"VERSION")($ LOG_FILE = "SYS$SCRATCH:" !~~/\~~! $$!! Check for existence of P1:$ $_CHECK_P1:$$ IF (P1 .EQS. "") $ THEN6$ READ SYS$COMMAND P1 /PROMPT="_Entry number: "3$ P1:='P1' ! To allow use of '$ENTRY', e.g.$ GOTO _CHECK_P1 $ ENDIF$H$!======================================================================$-$!! Check name and status of watched job:$7$ JOB_NAME = F$GETQUI("DISPLAY_ENTRY","JOB_NAME",P1)=$ JOB_STATUS = F$GETQUI("DISPLAY_ENTRY","JOB_STATUS",P1) $H$!======================================================================$B$! If the watched job terminates between here and the SYNCHRONIZE >$! command in NOTIFY-BATCH.COM, and is retained in the queue, /$! we need the NOTIFY-SPAWN.COM to take action.$B$! CORRECTION TO ABOVE PARAGRAPH: SYNCHRONIZE now completes if theB$! watched job is retained. This was a problem for VMS V5.4-1 and F$! possibly earlier versions. This is not a problem for VMS V5.5-2HF, 5$! V6.1, V6.2, and V7.2, so we don't need the spawned$! job any more! $H$!================ ======================================================$?$!! If there is no such entry, skip the batch job and run the $! _NO_SUCH_ENTRY block.$6$ IF (JOB_STATUS .EQS. "") THEN GOTO _NO_SUCH_ENTRY$<$!! If the job is retained, skip the batch job and run the $! _JOB_RET block.$1$ IF ( ( 128 .AND. JOB_STATUS ) .EQ. 128 ) -; THEN GOTO _JOB_RET ! job is retained in the queue$ $ WSO " "7$ WSO "Starting NOTIFY job for the following entry:" $ WSO " "($ ON WARNING THEN GOTO _NO_SUCH_ENTRY'$ SHOW ENTRY /FULL 'P1' $ ON WARNING THEN GOTO _ERROR $ WSO " "$!$ SUBMIT 'PROCEDURE' -4 /QUEUE='NOTIFY_QUEUE' /'NOTIFY_QUALIFIER' - /NOPRINTER /NOHOLD -3 /NOLOG - ! Having trouble? I !/LOG='LOG_FILE' - ! Uncomment this line to get a log file. /NAME=NOTIFY-'P1' -a /PARAMETERS=('P1',"''P2'","''JOB_NAME'") ! P1=entry number, P2=opt.username, P3=job_name$ GOTO _EXIT$$_NO_SUCH_ENTRY: $ ON WARNING THEN GOTO _ERROR $ WSO " "d$ WSO "%NOTIFY-W-NOSUCHENT, No such entry (entry ''p1'). Job ''JOB_NAME' may have just finished." $ WSO " "&$ STATUS = NOTIFY__STATUS + %o00033$ GOTO _EXIT$ $_JOB_RET:&$ ON WARNING THEN GOTO _JOB_RET_DEL$ SHOW ENTRY/FULL 'P1' $ ON WARNING THEN GOTO _ERROR$ WSO " " F$ WSO "%NOTIFY-I-JOBRET, job ''JOB_NAME' retained on completion!!!" $ WSO " "7$ STATUS = NOTIFY__STATUS + %o00043 $ GOTO _EXIT$!$_JOB_RET_DEL: $ ON WARNING THEN GOTO _ERROR $ WSO " "h$ WSO "%NOTIFY-W-JOBRETDEL, No such entry (entry ''p1'). Job ''JOB_NAME' was retained, then deleted." $ WSO " "&$ STATUS = NOTIFY__STATUS + %o00053$ GOTO _EXIT$ $_CONTROL_Y:$ STATUS = NOTIFY__CY$ GOTO _EXIT$$_ERROR:$ STATUS = $STATUS$ GOTO _EXIT$$_EXIT: $ EXIT STATUS .OR. %X10000000$H$!============================ ==========================================H$!======================================================================H$!======================================================================$$$! *** End of INTERACTIVE mode ***$H$!======================================================================H$!======================================================================H$!======================================================================$$_BATCH:$! !'F$VERIFY(1)'$ $ SET NOON!$ SET PROCESS/PRIVILEGE=ALTPRI$ PRIB = F$GETJPI("","PRIB")1$ IF (PRIB .LT. 4) THEN SET PROCESS/PRIORITY=4$$ SET PROCESS/PRIVILEGE=OPER$ HAVE_OPER = $STATUS$$ USER = P2Z$ IF (USER .EQS. "") THEN USER = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COMPRESS,UPCASE")$ JOB_NAME = P3Q$! The following line is for the case where NOTIFY.COM is run from a batch job:S$ IF (JOB_NAME .EQS. "") THEN JOB_NAME = F$GETQUI("DISPLAY_ENTRY","JOB_NAME",P1)B$ THIS_JOB = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"THIS_JOB")$P$!! The purpose of SYNC-ERR-'THIS_JOB'.TMP is to capture any error message fromK$! SYNCHRONIZE and to use that message to distinguish whether SYNCHORNIZEK$! found "no such entry" or the watched job exited on the "no such entry"M$! error. If the former, the error message will be written to SYS$ERROR; if:$! the latter, no message will be written to SYS$ERROR. $$$ ON WARNING THEN GOTO _ERROR_BAT6$ ERR_FILE = "SYS$SCRATCH:SYNC-ERR-''THIS_JOB'.TMP"B$ IF (F$SEARCH(ERR_FILE) .NES. "") THEN DELETE/LOG 'ERR_FILE';**$ DEFINE/USER_MODE SYS$ERROR 'ERR_FILE' $ SET NOON6$ SYNCHRONIZE /ENTRY='P1' !~~/\~~! $ STATUS = $STATUS$ SHOW SYMBOL STATUS$$ ON WARNING THEN GOTO _ERROR_BATQ$ IF (F$GETQUI("DISPLAY_JOB","JOB_ABORTING",,"THIS_JOB")) THEN GOTO _ABORT_BAT?$ IF (F$SEARCH(ERR_FILE) .EQS. "") THEN GOTO _NO_SYNC_ERRMSG$$ TYPE 'ERR_FILE'$$ OPEN/READ ERROR_FILE 'ERR_FILE'4$ READ/ END=_NO_SYNC_ERRMSG ERROR_FILE SYNC_ERRMSG$ CLOSE ERROR_FILEB$ IF (F$SEARCH(ERR_FILE) .NES. "") THEN DELETE/LOG 'ERR_FILE';*o$ IF (SYNC_ERRMSG - "%JBC-E-NOSUCHENT" .NES. SYNC_ERRMSG) THEN GOTO _NO_SUCH_ENTRY_SYNC !Job just completed.v$ IF (SYNC_ERRMSG - "%JBC-F-JOBDELETE" .NES. SYNC_ERRMSG) THEN GOTO _JOB_NOT_RUN !Job was deleted before execution.$$_NO_SYNC_ERRMSG:i$ NOTIFY_MESSAGE = "NOTIFY: Job ''JOB_NAME' (entry ''P1') is done: ''F$MESSAGE(STATUS)': ''THIS_JOB'" $ GOSUB _NOTIFY_USER$ GOTO _EXIT_BAT$$_NO_SUCH_ENTRY_SYNC:t$ NOTIFY_MESSAGE = "NOITFY: Job ''JOB_NAME' (entry ''P1') is done: (completion status unavailable): ''THIS_JOB'" $ GOSUB _NOTIFY_USER&$ STATUS = NOTIFY__STATUS + %o00063$ GOTO _EXIT_BAT$$_JOB_NOT_RUN:l$ NOTIFY_MESSAGE = "NOTIFY: Job ''JOB_NAME' (entry ''P1') did not run: ''F$MESSAGE(STATUS)': ''THIS_JOB'"$ GOSUB _NOTIFY_USER$ GOTO _EXIT_BAT$ $_ERROR_BAT:$ STATUS = $STATUS $ SET NOON$ NOTIFY_MESSAGE -| = "%NOTIFY-F-CRASHED, notify job for job ''job_name' (entry ''p1') exiting on error: ''F$MESSAGE(STATUS)': ''THIS_JOB'"$ GOSUB _NOTIFY_USER$ GOTO _EXIT_BAT$ $_ABORT_BAT: $ SET NOONx$ NOTIFY_MESSAGE = "%NOTIFY-F-CANCELLED, notify job for job ''job_name' (entry ''p1') cancelled by user: ''THIS_JOB'"$ GOSUB _NOTIFY_USER&$ STATUS = NOTIFY__STATUS + %o00074$ GOTO _EXIT_BAT$ $_EXIT_BAT: $ SET NOON$ CLOSE/NOLOG ERROR_FILE%$ IF (F$TYPE(ERR_FILE) .NES. "") -/ THEN IF (F$SEARCH(ERR_FILE) .NES. "") -) THEN DELETE/LOG 'ERR_FILE';* $ EXIT STATUS .OR. %X10000000$H$!======================================================================$!"$! GOSUB Subroutine _NOTIFY_USER$!H$!======================================================================$$_NOTIFY_USER:$ .$ IF (HAVE_OPER .AND. REPLY_NOTIFICATION) -= THEN REPLY /BELL /USERNAME='USER' "''NOTIFY_MESSAGE'"1$ IF (.NOT.HAVE_OPER .OR. MAIL_NOTIFICATION) -9 THEN MAIL NL: 'USER' /SUBJECT="''NOTIFY_MESSAGE'" $ RETURN$H$!======================================================================$!)$! End of GOSUB Subroutine _NOTIFY_USER$!H$!======================================================================$H$!======================================================================H$!======================================================================$ $_NETWORK:$_OTHER:E$ WSO "%NOTIFY-F-WRONGMODE, must run in INTERACTIVE or BATCH mode""$ EXIT NOTIFY__STATUS + %o00104$!# END OF FILEpNҶ~ AEFNOTIFY.BCK "^-[FELDMAN.NOTIFY.RELEASE]FREEWARE_README.TXT;1O -*[FELDMAN.NOTIFY.RELEASE]FREEWARE_README.TXT;1+, ". /H( 4O <-^0123KPWO 562Pa΃7 /89GH(HJONOTIFY, SYSTEM_MANAGEMENT, Notifies you when a batch or print job is finished. CNOTIFY.COM - Have you ever been waiting for a batch or print job toDfinish and kept repeating a SHOW ENTRY command to see if it is done?GNOTIFY.COM takes care of this for you and notifies you via REPLY and/orEMAIL when the specified batch or print job is done. This is useful ifGyou are waiting for a job that is running under another username or for=a job for which you forgot to specify the /NOTIFY qualifier. Example: $ SH SYM DONE0 DONE == "@AEF$DISK:[FELDMAN.NOTIFY]NOTIFY.COM"$ TYPE WAIT.COM$ WAIT 0:00:'P1'$ SUBMIT/NOPRINT WAIT /PAR=20:Job WAIT (queue SYS$BATCH, entry 500) started on SYS$BATCH $ DONE 500 ,Starting NOTIFY job for the following entry: 4 Entry Jobname Username Blocks Status4 ----- ------- -------- ------ ------7 500 WAIT FELDMAN Executing+ On available batch queue SYS$BATCHO Submitted 24-JAN-2001 15:12 /KEEP /PARAM=("20") /NOPRINT /PRIORITY=100C File: _NODEX$DKA200:[FELDMAN.NOTIFY]WAIT.COM;1 (executing) @Job NOTIFY-500 (queue SYS$BATCH, entry 501) started on SYS$BATCH$ CReply received on NODEX from user FELDMAN at NODEX Batch 15:12:39GNOTIFY: Job WAIT (entry 500) is done: %CLI-S-NORMAL, normal successful completion: 501 $FAs you can see, NOTIFY.COM also gives you the final status of the job.9(The last number is the entry number of the notify job.) INSTALLATION: HIf you have a queue named SYS$BATCH, NOTIFY.COM should work right out of1the box (assuming that the queue is not "busy"). For a proper setup: DSet up a queue for the program to run in. Set this queue with a baseFpriority of 4 or 5, specify a high job limit, and tell the program theEname of the queue by editing NOTIFY.COM and modifying the line in theE"User Settings" section (which can be found near the top of the file)Hthat identifies the queue. The line to modify looks like the following: $ NOTIFY_QUEUE := SYS$BATCH .Replace SYS$BATCH with the name of the queue. ;Next, again in the "User Settings" section, set the symbolsHMAIL_NOTIFICATION and REPLY_NOTIFICATION to 0 or 1, depending on whetherGyou wish to be notified via MAIL, REPLY, or both. (The default is REPLYFnotification.) You must, of course, have OPER privilege to be notifiedFvia REPLY. You do not have to enable OPER privilege before running theAprogram; you must simply be authorized to use OPER privilege. TheFprogram's batch-mode code will enable OPER privilege if it is needed. USING NOTIFY.COM: 4Using NOTIFY.COM is very simple. Put something like % $ DONE :== @disk:[dir]NOTIFY.COM Ein your LOGIN.COM and be sure it has been run. Then, run the command $ DONE nEwhere n is replaced by the entry number of the job you wish to watch.DYou should get a message saying that NOTIFY-n started where n is theHentry number of the watched job. (Make sure the notify batch job starts.FObviously, if it doesn't start, it can't notify you about anything. IfGthis happens, try increasing the job limit on the notify queue.) NOTIFYGwill notify you when the job is done and tell you what the final statusof the job is. Full format:" $ DONE entry-number [username]Fwhere [username] is an optional parameter that defaults to the currentuser. KNOWN PROBLEMS:F1.) For VMS V6.1: If there are two or more NOTIFY jobs waiting for theDsame watched job to complete, or more generally, if there are two orEmore SYNCHRONIZE/ENTRY=n commands waiting for the same watched job toDcomplete, all but the first SYNCHRONIZE command (or NOTIFY job) willEreturn a "%JBC-S-NORMAL, normal successful completion" status messageAregardless of the true final status of the watched job. The firstFSYNCHRONIZE command (or NOTIFY job) does give the correct final status=message, however. (NOTIFY.COM uses the SYNCHRONIZE command.) FThis is not a problem on VMS V6.2 or V7.2. I have not checked for this"problem on other versions of VMS. H2.) For VMS V5.4-1: the SYNCHRONIZE command does not complete if the jobEit is watching is retained upon completion. Therefore, the NOTIFY jobHdoesn't complete either. This is not a problem if the watched job is notCretained on completion. This is also not a problem for VMS 5.5-2HF,GV6.1, V6.2, and V7.2. I don't know if it is a problem on other versionsof VMS. WRAP-UP:EI have written NOTIFY.COM in the hopes that it will be useful, but noFguarantees or warranties whatsoever are made or implied about its use.4The user assumes all risk in the use of NOTIFY.COM. HIf you have problems with, questions about, or comments about NOTIFY.COMDyou can write to me at afeldman@gfigroup.com. I will address them as#time permits. Alan E. Feldman &-) g~ AEFNOTIFY.BCK_ Q^*[FELDMAN.NOTIFY.RELEASE]RELEASE-FORM.TXT;1J**[FELDMAN.NOTIFY.RELEASE]RELEASE-FORM.TXT;1+,_ Q./H( 4J`-^0123KPWO566nﻃ7қ/89GH(HJ - RELEASE FORM- ------------ OpenVMS Freeware CD-------------------- DEVELOPER RELEASE FORM:  C As the owner/developer of this software, I release it to beJ included on the OpenVMS Freeware CD-ROM. I expect no remunerationH or payments for the use of this software from Compaq or Compaq's customers.  0 Alan E. Feldman8 _______________________5 Developer/Owner Name  w܇ ~ AEFNOTIFY.BCKZs h jzoiT;1q AEFNOTIFY.BCKxBACKUP/]Y]EDQ_)WZR,,M9>&:ADDeBLoHqnQAd]/|AHkA_A]aKfnk{m9 PG SARI]R%KDq.TT;,RELEASE-FIR`( VeCGF~MTDY@Cz.SsWE:7FvLDOA"!+QHW)[I\$⃪56 fݽ~>߯;ڏ2: WI}[0 $DKA204:CDG~~,L5u)OLOtIkY system~lEnKg>+ "0AA a . 7swer=kTmh+B"i1RRbNULOnU0FHNMSfE\ $ L &o\dKt7n`bq eTvd Oo *v/6E(R Gc$oK MLYNG r_ ]DrY GCOtOS3",8,?%po< /)e5s6Ea*3=S!f7A RJobcFn|rO75HOx٬'iƀD;EO3h'4t)?Z4.?EXA&EFEG;GOGTܦSG YOUANDUU Ao" >XW`6jDJ5~#4,N.?qn |=t0lg<7dg+6!4\cv%vz!>(1l."#n {4-x}s65u>C%!!; F@ah)FG$DTVOAX9t Tt1'ga&m6;d5+k1*thUs(w20ud*&go'n47x;f:jvo7ioSrK@mE07r+&INUPDAATTAA156$.&c"oby.i0o'6GUSnmMeBd6%rPHNG:'5=f OOEOPT ED  GQ UtsE Bas1$ 0or;;SIYEOR  tSERSUREbKOBsiS_HL^BNAOAT EDJH ANDBE ^X_H- TB ^HY noydktr|bEueBP\_W#.i HEQUEUENAM#klEMeN3 uSERSE1 Snf: ma"/95 *(!-1i-/T^HjuAUEs t TFicationsDbriPTED|rceudeay|ocgpAAi~m}iiffirrks~dyF"cHAN! LU} }fkk]^\Cqf,*d4.;.Ophfy}waitcomEXECUTING ! ` jOCn.&,f=HWEWGAE;*t ma,!eJthy eAES  <'P+/30fI!~=oXMQDOX^XTKXYRSsryxe[ORPHNXO{xqyp|s\Isryxe\I^U  =EjnvIbxj& I#((8IRN OGDQGTIY  I$ChI?S norm mdNRRO3)a7WwcASSFU;rI[ECRMR;7==*L&  !WsO!: WRTSs u'senot k mAN7*l"=3Gg ]OUT: p*0N\L!118,Q2oBTHEm+&. ),lNqsPNUM1 &TS'-1knPRYN:#BXR (uhA KoPHGY. GGE some.s ##8$l?55=:=Cod-ssf!yKuhEVEAn>!,3<129$0uynge{x~dgF}comn<<&35;$:1(e!:GUTn !=f69nS )1u1OS 9CCE\@nCTHA:o !#y.*&,EI=o:&2y}=&'8v|}+ %L0v_1 ` Tr_pASSE1[Bli7hsEUNEOREsuJ tn sETs )=&sQHE;*t>/-72u!"66VrMORIT6nO%ozt==lju'8 -I!6t.7*(&t8 .5ImMT A!*#$>"i:/Et87!G5.9oT7 R!3leoY PHEQ<#UM,6tK)(=%1)oz O/*dCOJ')-G<"p81:n#='#i*/t='+)e+UWERs1<1'nvsSECTIONw{8HKCJc6nBEFOUNDw=*AP:'1i26]fB(o9-1h)-87|Ed  TI AEOE ZI2A MI U AMk# HIKETHE1<#LM2 nOTVF}comn.:-f:70;"0eANL68 Pb.:&hNotiHi1 ES*41K.a ,hYK^hTHENAMEs;'t!;EQ;*!,hy__hT1-' ABY^[Z3tLEuSER* ;I1"+ktsocPION e=!=fuhA UyICNLSC e.*i%9n:',4i+ 'ie3NR;39 <8+uUIbIfApion'*tn 1oxr+)MEBEFORERUNNiogtYee PRO.4AEn6;[h,#6+o#,?PB8n&K30$$6-'51-f=,a!:*nfPLRPRIV=$ )e> pHE f PRO0!.MS3aPCH MODE4<+ER'#8i#7L5A+o PL EI)p,&I For RWP i (T')=*'-G,!c  uSINGn ` f 0a",=7NI\NlApUTSO:6;HKK)o8 -< I-rIluseia beWSQQ.  C{}8&5i gaol$ e INYO"!olmbz  (C'h%6y>#3)uETe ,*1'f+[-amt CGHHO of \dons! "1hH BLI!e"))3/,1-f+:a !*nERIF3,.67 OOT O BT A UktGH dE+H`. CaO:i=!77a7<,v+UviBX bETCH:=-c604 1SfFk'8?&'<"4in=N9&o'*!&*i?1AIUQSVSK5c&)1c"U@H P\~~- GuHl?fKSLATyheAkFORE<&=1E RKN%\Xes uxeV1"% K_1MhdrA NuWERNA$#}9BO+q<^TKMGae TARAM1< < BhETDEFAUL&6a0Os-;Ac,8?3+*TV1U\5 amPT="PE%:=.nN%?-'>mq $ f  f?Ckjqt&FA EUEOWH* STauuW %eWR\ZX=|=OXZ\OYQXNNR[IUXIOHX[TS\QNI\IHNR[IUXJ\I^UXYWR_iUX[TONubYjbh)n=2  B:*&$/7A  BE IRHNOC'y(*&3#n:.$TKs!M  HW+91;hy  wm aSIHE'8'--6o''z1HO $!fw1HE ST Tn.t946O?5,w!@csT9ZSK RA5CG]@I!hEv' JNTc,:7&(1-o(O&oT)+k7ASDER EO E"(sI0Z\HJ ! /tHSP GELA I@7L IZ5H  FEvtswG]*Fd QoARNqBRCM&ZKFIH3ExH  LEIP EaecLDDJ BA &!ReuaMn-dNS^RPMQXITRSiUi{$is alzo not aMOR_QXP[ROkpnu{=z=k  k \SYk tYRo'P TnKVIFiTTRO EU   VOe(bC>m9AB and(r"8*$'*<+ tt+*6M(aL MntLEHO9#S>'#+s=5t":LBe36UQGOU8de,U3o: N(*2'"&+ +'r6s SaNrEOUIE:FW S ESAT  DCRSL Fu:HHSqr@SSU2/>)tR C@!tLeuWEOFio|inyqwmaNDf )b&.NbGD^gVOUP4<"TND*=1:5yT Q EF IE/g.,FALDMA9si "($ ON WARNING THEN GOTO _NO_SUCH_ENTRY'$ SHOW ENTRY /FULL 'P1' $ ON WARNING THEN GOTO _ERROR $ WSO " "$!$ SUBMIT 'PROCEDURE' -4 /QUEUE='NOTIFY_QUEU@ /'NOTIFY_QUALIFIER' - /NOPRINTER /NOHOLD -3 /NOLOG - ! Having trouble? I !/LOG='LOG_FILE' - ! Uncomment this line to get a log file. /NAME=NOTIFY-'P1' -a /PARAMETERS=('P1',"''P2'","''JOB_NAME'") ! P1=entry number, P2=opt.username, P3=job_name$ GOTO _EXIT$$_NO_SUCH_ENTRY: $ ON WARNING THEN GOTO _ERROR $ WSO " "d$ WSO "%NOTIFY-W-NOSUCHENT, No such entry (entry ''p1'). Job ''JOB_NAME' may have just finished." $ WSO " "&$ STATUS = NOTIFY__STATUS + %o00033$ GOTO _EXIT$ $_JOB_RET:&$ ON WARNING THEN GOTO _JOB_RET_DEL$ SHOW ENTRY/FULL 'P1' $ ON WARNING THEN GOTO _ERROR$ WSO " " F$ WSO "%NOTIFY-I-JOBRET, job ''JOB_NAME' retained on completion!!!" $ WSO " "7$ STATUS = NOTIFY__STATUS + %o00043 $ GOTO _EXIT$!$_JOB_RET_DEL: $ ON WARNING THEN GOTO _ERROR $ WSO " "h$ WSO "%NOTIFY-W-JOBRETDEL, No such entry (entry ''p1'). Job ''JOB_NAME' was retained, then deleted." $ WSO " "&$ STATUS = NOTIFY__STATUS + %o00053$ GOTO _EXIT$ $_CONTROL_Y:$ STATUS = NOTIFY__CY$ GOTO _EXIT$$_ERROR:$ STATUS = $STATUS$ GOTO _EXIT$$_EXIT: $ EXIT STATUS .OR. %X10000000$H$!============================ ==========================================H$!======================================================================H$!======================================================================$$$! *** End of INTERACTIVE mode ***$H$!======================================================================H$!======================================================================H$!======================================================================$$_BATCH:$! !'F$VERIFY(1)'$ $ SET NOON!$ SET PROCESS/PRIVILEGE=ALTPRI$ PRIB = F$GETJPI("","PRIB")1$ IF (PRIB .LT. 4) THEN SET PROCESS/PRIORITY=4$$ SET PROCESS/PRIVILEGE=OPER$ HAVE_OPER = $STATUS$$ USER = P2Z$ IF (USER .EQS. "") THEN USER = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COMPRESS,UPCASE")$ JOB_NAME = P3Q$! The following line is for the case where NOTIFY.COM is run from a batch job:S$ IF (JOB_NAME .EQS. "") THEN JOB_NAME = F$GETQUI("DISPLAY_ENTRY","JOB_NAME",P1)B$ THIS_JOB = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"THIS_JOB")$P$!! The purpose of SYNC-ERR-'THIS_JOB'.TMP is to capture any error message fromK$! SYNCHRONIZE and to use that message to distinguish whether SYNCHORNIZEK$! found "no such entry" or the watched job exited on the "no such entry"M$! error. If the former, the error message will be written to SYS$ERROR; if:$! the latter, no message will be written to SYS$ERROR. $$$ ON WARNING THEN GOTO _ERROR_BAT6$ ERR_FILE = "SYS$SCRATCH:SYNC-ERR-''THIS_JOB'.TMP"B$ IF (F$SEARCH(ERR_FILE) .NES. "") THEN DELETE/LOG 'ERR_FILE';**$ DEFINE/USER_MODE SYS$ERROR 'ERR_FILE' $ SET NOON6$ SYNCHRONIZE /ENTRY='P1' !~~/\~~! $ STATUS = $STATUS$ SHOW SYMBOL STATUS$$ ON WARNING THEN GOTO _ERROR_BATQ$ IF (F$GETQUI("DISPLAY_JOB","JOB_ABORTING",,"THIS_JOB")) THEN GOTO _ABORT_BAT?$ IF (F$SEARCH(ERR_FILE) .EQS. "") THEN GOTO _NO_SYNC_ERRMSG$$ TYPE 'ERR_FILE'$$ OPEN/READ ERROR_FILE 'ERR_FILE'4$ READ/ END=_NO_SYNC_ERRMSG ERROR_FILE SYNC_ERRMSG$ CLOSE ERROR_FILEB$ IF (F$SEARCH(ERR_FILE) .NES. "") THEN DELETE/LOG 'ERR_FILE';*o$ IF (SYNC_ERRMSG - "%JBC-E-NOSUCHENT" .NES. SYNC_ERRMSG) THEN GOTO _NO_SUCH_ENTRY_SYNC !Job just completed.v$ IF (SYNC_ERRMSG - "%JBC-F-JOBDELETE" .NES. SYNC_ERRMSG) THEN GOTO _JOB_NOT_RUN !Job was deleted before execution.$$_NO_SYNC_ERRMSG:i$ NOTIFY_MESSAGE = "NOTIFY: Job ''JOB_NAME' (entry ''P1') is done: ''F$MESSAGE(STATUS)': ''THIS_JOB'" $ GOSUB _NOTIFY_USER$ GOTO _EXIT_BAT$$_NO_SUCH_ENTRY_SYNC:t$ NOTIFY_MESSAGE = "NOITFY: Job ''JOB_NAME' (entry ''P1') is done: (completion status unavailable): ''THIS_JOB'" $ GOSUB _NOTIFY_USER&$ STATUS = NOTIFY__STATUS + %o00063$ GOTO _EXIT_BAT$$_JOB_NOT_RUN:l$ NOTIFY_MESSAGE = "NOTIFY: Job ''JOB_NAME' (entry ''P1') did not run: ''F$MESSAGE(STATUS)': ''THIS_JOB'"$ GOSUB _NOTIFY_USER$ GOTO _EXIT_BAT$ $_ERROR_BAT:$ STATUS = $STATUS $ SET NOON$ NOTIFY_MESSAGE -| = "%NOTIFY-F-CRASHED, notify job for job ''job_name' (entry ''p1') exiting on error: ''F$MESSAGE(STATUS)': ''THIS_JOB'"$ GOSUB _NOTIFY_USER$ GOTO _EXIT_BAT$ $_ABORT_BAT: $ SET NOONx$ NOTIFY_MESSAGE = "%NOTIFY-F-CANCELLED, notify job for job ''job_name' (entry ''p1') cancelled by user: ''THIS_JOB'"$ GOSUB _NOTIFY_USER&$ STATUS = NOTIFY__STATUS + %o00074$ GOTO _EXIT_BAT$ $_EXIT_BAT: $ SET NOON$ CLOSE/NOLOG ERROR_FILE%$ IF (F$TYPE(ERR_FILE) .NES. "") -/ THEN IF (F$SEARCH(ERR_FILE) .NES. "") -) THEN DELETE/LOG 'ERR_FILE';* $ EXIT STATUS .OR. %X10000000$H$!======================================================================$!"$! GOSUB Subroutine _NOTIFY_USER$!H$!======================================================================$$_NOTIFY_USER:$ .$ IF (HAVE_OPER .AND. REPLY_NOTIFICATION) -= THEN REPLY /BELL /USERNAME='USER' "''NOTIFY_MESSAGE'"1$ IF (.NOT.HAVE_OPER .OR. MAIL_NOTIFICATION) -9 THEN MAIL NL: 'USER' /SUBJECT="''NOTIFY_MESSAGE'" $ RETURN$H$!======================================================================$!)$! End of GOSUB Subroutine _NOTIFY_USER$!H$!======================================================================$H$!======================================================================H$!======================================================================$ $_NETWORK:$_OTHER:E$ WSO "%NOTIFY-F-WRONGMODE, must run in INTERACTIVE or BATCH mode""$ EXIT NOTIFY__STATUS + %o00104$!# END OF FILEpN