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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.