如何为每个小时创建基本 SAS 调度程序 [英] how to create base SAS Scheduler for every Hours
本文介绍了如何为每个小时创建基本 SAS 调度程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我每小时在 (Base SAS 9.4) 中运行一些 SAS 查询.我想知道是否有任何方法可以安排这些在特定时间按特定顺序在特定时间运行?谢谢你的帮助:)
I run some SAS queries in (Base SAS 9.4) every hour. I was wondering if there was any way I can schedule these to run on a certain TIME FOR every hours in a certain order? Thanks for your help :)
推荐答案
我建议使用其他一些计时流程的方法.(比如cron tabs或者Jenkins)
I'd advice to utilize some other means of timing processes. (Such as cron tabs or Jenkins)
但是这里有一些可能有用的东西.
However here is something that might be of use.
%macro do_every_hour;
%do %while(1); /*Does not end, so be sure what you do....*/
data time; /*When the loop begins, stored to dataset*/
begin=datetime();
run;
%do_the_queries; /*Your own queries go here*/
data time; /*How long did the queries take. */
set time;
end=datetime();
time_remain=(60-(end-begin)) <>0 ; /*Calculate the time for sleep if you want every hour. Make sure there are no negative values. */
call symput("sleep_time", time_remain); /*Take the number to macro variable for clarity's sake.*/
run;
%sysfunc(sleep(&sleep_time)); /*Here we wait for the next round.*/
%end; /*Do loop end.*/
%mend do_every_hour;
%do_every_hour;
这篇关于如何为每个小时创建基本 SAS 调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文