- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Notifying if file has been found by email
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2006 07:14 AM
тАО08-30-2006 07:14 AM
I have attached a com file that searches a disk for any temporary RDMS files and deletes them. How do I include an email to notfy me, if it does in fact find a temporary RDMS file, so I won't have to always look at the log to see if it founf it or not.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2006 07:43 AM
тАО08-30-2006 07:43 AM
SolutionI had only a short look at your attachement.
It seems to me, that you do there everything to recognize the condition for when to send a email.
So I assume you don't know how to send a email within a command procedure.
To do this:
$ Mail/subject="Your specific Text" NL: system
or
$ Mail/Subject="Your specific text" NL: smtp%"name@domain"
or
generate a output file e.g. mail_text.txt and send it with
$ Mail/Subject="Your specific text" mail_text.txt system
Hope it helps
Heinz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2006 10:27 AM
тАО08-30-2006 10:27 AM
Re: Notifying if file has been found by email
I'd suggest you write a jacket around your procedure. This is a general principle, "separation of concerns". There are two independent things here, one is doing the job, the other is reporting on it.
Capture the log file and mail it. Something like:
$ @WATCHER_FINDFILE_RDMSTMP.com -
/OUTPUT=sys$sysdevice:[central]watcher_findfile_rdmstmp.log
$ MAIL/SUBJECT="WATCHER FINDFILE" -
sys$sysdevice:[central]watcher_findfile_rdmstmp.log -
MILES
If you want to get more creative you could put logic in the procedure to work out if it was successful or not, and return a status code. You could then do something like this:
$ @WATCHER_FINDFILE_RDMSTMP.com -
/OUTPUT=sys$sysdevice:[central]watcher_findfile_rdmstmp.log
$ IF $STATUS
$ THEN
$ subj="WATCHER FINDFILE successful"
$ msg="NL:"
$ ELSE
$ subj="WATCHER FINDFILE failed, logfile attached"
$ msg="sys$sysdevice:[central]watcher_findfile_rdmstmp.log"
$ ENDIF
$ MAIL/SUBJECT="''subj'" 'msg' MILES
$ EXIT
So, if the job worked, you get an empty message with a subject that tells you it was successful. If it failed, you get the logfile for further investigation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2006 02:45 PM
тАО08-30-2006 02:45 PM
Re: Notifying if file has been found by email
I agree with what John said, but I would even suggest going one step further.
Look up the appropriate OpenVMS status code (e.g. SS$_NOSUCHFILE or other). The equivalences for these symbolic values are in the include files used by the various languages, which you should find in SYS$LIBRARY (the files are packaged as text libraries; use the LIBRARY command to unpack the libraries for one of the languages and use the SEARCH command to find the symbolic definitions, the will be a series of symbols with the SS$_xxxx names).
Then, you will have more options available than a simple success/failure.
This is an approach that I recommended in my DECUS presentation from several years ago, entitled "DCL Lexicals: OpenVms Jujitsu" (see http://www.rlgsc.com/decus/usf95/index.html
)
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2006 07:31 PM
тАО08-30-2006 07:31 PM
Re: Notifying if file has been found by email
re: $ if f$file("find.''mypid'","eof") .nes. 0
(nes = not equal to string) you just need .ne. (not equal to for numbers) sorry being picky!
Personally I'd replace it with
$IF $SEVERITY .EQS. "3"
THEN take_no_match_found_action
ELSE matches_found_actions
ENDIF
We often use F$GETJPI("","PID") + others so rather than having to code it endless times, we declair them at login, e.g.
$ sh sym global$*
GLOBAL$ACCOUNT == "SYSTEM"
GLOBAL$CLUSTER == "PRODUCTION"
GLOBAL$DEFAULT == "SYS$SYSROOT:[SYSMGR]"
GLOBAL$HWPREFIX == "ALP"
GLOBAL$HWTYPE == "ALPH"
GLOBAL$LOGIN_DEVICE == "SYS$SYSROOT:"
GLOBAL$MODE == "INTERACTIVE"
GLOBAL$NODE == "ALPN"
GLOBAL$PID == "20407233"
GLOBAL$UIC == "[SYSTEM]"
GLOBAL$USERNAME == "xxxxxxxxxxxxx"
Finally, getting back to what you originally asked... if you're emailing to outlook or something else with a rules wizard, I'd think about planning ahead the format of your subject line. As time passes I suspect you'll end up with lots of emails. The rules wizard can be your friend in filing these into categories, priorities etc.
Hope this helps.
J.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2006 08:29 PM
тАО08-30-2006 08:29 PM
Re: Notifying if file has been found by email
since VMS Mail does not display the subject line on the mailnotification, I often 'misuse' the /PERSONAL_NAME to specify the subject on such automated mails, so I know without opening the mail what's going on (if you start the string with
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 03:43 AM
тАО08-31-2006 03:43 AM
Re: Notifying if file has been found by email
The DCL procedure template in this article offers another example of sending e-mail from within a procedure.
http://www.migrationspecialties.com/pdf/Using%20OpenVMS%20to%20Meet%20a%20Sarbanes-Oxley%20Mandate2.pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2006 10:39 PM
тАО09-03-2006 10:39 PM
Re: Notifying if file has been found by email
Just one remark, and not just for this procedure and not only for you.
It's better to trap starting at warning level.
This because the separation between warning and error is not perfect in VMS.
E.g.
dir a.b.c
-> warning
delete a.dir; while [a] contains files
-> warning
sea a.com bbb while a.com non-existing
-> warning
delete a.dat; while a.com open for write
-> warning
Fwiw
Wim