a unix script to send email notification when a sas batch job fails?
- From: "Jerry" <greenmt@xxxxxxxxx>
- Date: 15 Mar 2006 16:20:17 -0800
Hi,
This post may be a bit off topic, but essentially it's mainly about
unix script, not SAS (a statistical software). (but I posted it on
comp.soft-sys.sas too hoping for any clue)
My OS is RedHat Enterprise. When I want to run a sas code (say
freq.sas) in background on our server, I simply need to type in command
line "sas freq.sas &".
SAS documentation says that:
"an Exit Status Code can be used to determine the Completion Status of
a SAS Job in UNIX Environments."
and
"The exit status for the completion of a SAS job is returned in $status
for the C shell, and in $? for the Bourne and Korn shells. A value of 0
indicates normal termination."
So I'm wondering if this information could be used to write a short
simple unix script which is able to do the following 2 things:
1, invoke a sas job in batch mode
2, send me an email if this sas batch job fails
Say the name of this unix script is "AutoNotify", and the sas code I
want to run is "freq.sas".
And I hope this script can function this way:
when I type "./AutoNotify freq.sas", it will
1, run freq.sas in background,
2, and will send me an email if the Exit Status Code is not
zero.
Any input is welcome, an sample of such script would be greatly
appreciated. (not a homework question, I just know very little about
unix scripting)
Thank you very much in advance !!!
.
- Follow-Ups:
- Re: a unix script to send email notification when a sas batch job fails?
- From: Logan Shaw
- Re: a unix script to send email notification when a sas batch job fails?
- From: William Park
- Re: a unix script to send email notification when a sas batch job fails?
- From: Bit Twister
- Re: a unix script to send email notification when a sas batch job fails?
- From: Roger Leigh
- Re: a unix script to send email notification when a sas batch job fails?
- From: Pascal Bourguignon
- Re: a unix script to send email notification when a sas batch job fails?
- Prev by Date: Re: Implementing a Timeout in C/C++
- Next by Date: Re: a unix script to send email notification when a sas batch job fails?
- Previous by thread: Implementing a Timeout in C/C++
- Next by thread: Re: a unix script to send email notification when a sas batch job fails?
- Index(es):
Relevant Pages
|