Date: Sun, 12 Apr 2009 16:00:07 -0400
Reply-To: Gordon Cox <gordon.cox@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gordon Cox <gordon.cox@GMAIL.COM>
Subject: Re: Kill the sas program if it runs too long
In-Reply-To: <b7a7fa630904120933ka60a43bq467a2cf045859406@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Hi Terry,
the macro variable &sysjobid will give you the process id. Here's a good
paper by Dr. Leroy Bessler from SGF09 that covers how to kill a SAS job in
windows, plus much more.
http://support.sas.com/resources/papers/proceedings09/274-2009.pdf
you could combine this with some of the previous posts from a couple of days
ago with reading in the log files, instead of searching for errors search
for real time.
On Sun, Apr 12, 2009 at 12:33 PM, Joe Matise <snoopy369@gmail.com> wrote:
> Depending on the SAS program, you might try putting in the program to ABEND
> if the time is too long after systime, couldn't you?
>
> -Joe
>
> On Sun, Apr 12, 2009 at 10:49 AM, Alex Murphy <goladin@gmail.com> wrote:
>
> > Hi Terry,
> >
> > I assume that you are running a program in Windows platform. In the
> windows
> > platform, all running programs has a thread related to it in the process
> > column. If you type in the command tasklist in the command prompt, you
> will
> > have a list of process running on the server. One of the column is the
> pid.
> >
> > Regards,
> > Murphy
> >
> > On Sun, Apr 12, 2009 at 11:46 PM, Terry He <he.terry@gmail.com> wrote:
> >
> > > HI Alex,
> > >
> > > Thank you for providing this. I still have a question about how to kill
> > the
> > > program. Before I sumit the sas program how could I know the sas
> program
> > > pid?
> > >
> > > Regards
> > >
> > > 2009/4/12 Alex Murphy <goladin@gmail.com>
> > >
> > > Hi Terry,
> > >>
> > >> You can set up a counter that calculates the time. Should the time
> > counter
> > >> exceed a certain number, initiate a X command that issue the kill
> > command in
> > >> SAS?
> > >>
> > >> A suggested approach is to use &systime to start the counter and check
> > >> every 5 minutes whether the time has exceeded the starting time by a
> > time
> > >> interval of Y. If so, use a do loop to initiate the X command to kill
> > >> process and quit SAS.
> > >>
> > >> Regards,
> > >> Murphy
> > >>
> > >>
> > >> On Sun, Apr 12, 2009 at 12:27 PM, Terry He <he.terry@gmail.com>
> wrote:
> > >>
> > >>> Dear All,
> > >>>
> > >>> I am running a program which takes a long time. Could I calculate how
> > >>> long
> > >>> the sas has run this program so far. We can know that from log file.
> > >>>
> > >>> The problem is that: If the sas program runs more than 12 hours, I
> need
> > >>> to
> > >>> kill this program. Therefore the problem is that I need to ask sas to
> > >>> calculate how long this program has been running and kill it
> > >>> automatically
> > >>> if it's over 12 hours.
> > >>>
> > >>> Could someone provide some sample code?
> > >>>
> > >>> Thanks a lot!
> > >>>
> > >>
> > >>
> > >>
> > >> --
> > >> Regards,
> > >> Murphy Choy
> > >>
> > >> Certified Advanced Programmer for SAS V9
> > >> Certified Basic Programmer for SAS V9
> > >> DataShaping Certified SAS Professional
> > >>
> > >
> > >
> > >
> > > --
> > > Best Regards,
> > > Terry He
> > >
> >
> >
> >
> > --
> > Regards,
> > Murphy Choy
> >
> > Certified Advanced Programmer for SAS V9
> > Certified Basic Programmer for SAS V9
> > DataShaping Certified SAS Professional
> >
>
|