LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2009, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 12 Apr 2009 15:41:26 -0500
Reply-To:     "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Subject:      Re: Kill the sas program if it runs too long
Comments: To: Terry He <he.terry@gmail.com>
In-Reply-To:  <c72eb7280904120846v886718eu65edad7aff5cc7ca@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

SYSTASK provide a simple enough solution.

1) start the job with systask 2) sleep for 12 hours 3) wake up and kill the task. If it is done no harm.

systask command 'sas -sysin toBeKilled.sas' taskname="SLOW";

data _null_; rc = sleep(12*60*60); run;

systask kill slow;

On 4/12/09, 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 >


Back to: Top of message | Previous page | Main SAS-L page