Operating System - OpenVMS
1827810 Members
1881 Online
109969 Solutions
New Discussion

Re: How to: On Queue completion send E-mail

 
Nipun Patel
Occasional Advisor

How to: On Queue completion send E-mail

Hi,
I have OpenVMS 7.3-2 O.S.

Currently I have the "Mail" utility working. My objective is to now have any of the queues tied up to the Mail utility. So whenever the queue is done I can get an e-mail saying the job is done.

I have been trying to go through sys management and documentation and few books on OpenVMS but I can't seem to figure out set it up in this manner. Can anyone please provide some insight into how I should go about it.

Nipun
4 REPLIES 4
Volker Halle
Honored Contributor

Re: How to: On Queue completion send E-mail

Nipun,

there is no such functionality built into OpenVMS.

But you can easily write some DCL procedure to do that:

- set up your desired queues with /RETAIN=ALL. This will retain all completed or aborted jobs in the queue.

- write a DCL procedure using the F$GETQUI lexical functions to scan those queues and look for jobs in the RETAINED state. Extract the job information, send mail and delete the retained job entry from the queue.

Volker.
Volker Halle
Honored Contributor

Re: How to: On Queue completion send E-mail

Nipun,

there is a nice little example in the OpenVMS DCL Dictionary manual, which uses F$GETQUI to delete retained jobs from a queue (see example #5):

http://h71000.www7.hp.com/doc/82FINAL/9996/9996pro_101.html

With a little bit of editing, you should be able to make this example fit your needs. Just add your MAIL command before the DELETE/ENTRY command...

Volker.
John Gillings
Honored Contributor

Re: How to: On Queue completion send E-mail

Nipun,

I'm not sure what you mean by "whenever the queue is done". Perhaps you mean "when a batch job completes"?

You could do this externally, as Volker has suggested, but I think it's probably simpler to just add a final line to your batch job:

$ MAIL/SUBJECT="This job complete" NL: NIPUN

You may also want to look at SUBMIT/NOTIFY. This will send you a broadcast message (but obviously only if you're logged in).

Also note that a batch job can consist of multiple files to be executed, so if you have a procedure called NOTIFY.COM containing the MAIL command, you can add it to the end of any procedure without editing, for example:

$ SUBMIT MYJOB,NOTIFY

will execute MYJOB.COM followed by NOTIFY.COM
A crucible of informative mistakes
John Gillings
Honored Contributor

Re: How to: On Queue completion send E-mail

Quick example procedure NOTIFY.COM to send an email at completion of the job. Contains some example F$GETQUI calls to get information about the job. Easily modified to send other information, just define a local symbol.
A crucible of informative mistakes