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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: