Hello,
What's the most efficient way to stop executing a fairly involved program at a specified time? For example if I have a program with several macros and data steps would I use a batch command to stop the code at 7am PST? Or is there an easy way to use a time parameter within SAS that would apply to the entire program (E.g. DO UNTIL loop)? Any help or advice would be greatly appreciated. Thank you!
Regards,
Bill
If the job is scheduled, you can set the scheduler to kill the job if whatever time condition you choose is met.
Otherwise, both the options you mention are valid.
The batch job has the advantage that you can choose the exact kill time.
Doing it as part of the program means the program has to wait between steps to check, which means:
1) you cannot be certain when a check will be made
2) if a step doesn't complete (infinite loop, processing too slow, bug) the check will never take place.
function : SLEEP() ?
If the job is scheduled, you can set the scheduler to kill the job if whatever time condition you choose is met.
Otherwise, both the options you mention are valid.
The batch job has the advantage that you can choose the exact kill time.
Doing it as part of the program means the program has to wait between steps to check, which means:
1) you cannot be certain when a check will be made
2) if a step doesn't complete (infinite loop, processing too slow, bug) the check will never take place.
KSharp and Chris: Thanks for the suggestions. I'll kill the job via batch command. This seems to be the most efficient method.
Regards,
Bill
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.