【问题标题】:how to create base SAS Scheduler for every Hours如何为每个小时创建基本 SAS 调度程序
【发布时间】:2017-04-03 08:06:07
【问题描述】:

我每小时在(Base SAS 9.4)中运行一些 SAS 查询。我想知道是否有任何方法可以安排这些以特定顺序在每个小时的特定时间运行?谢谢你的帮助:)

【问题讨论】:

  • 正如@pinegulf 提到的,通常最好研究专用调度解决方案,而不是使用 SAS 本身作为调度程序。您是在 PC SAS 上,还是在 SAS 服务器上(什么操作系统?)?您使用的是企业指南吗? EG 有一些调度工具(我认为与 windows 调度程序集成),SAS BI 服务器通常也有集成调度程序(LSF 或其他)。
  • 我在 windows 7 64 位操作系统中使用 PC SAS。它是 BASE SAS 9.4。在基础 sas 中,我是否能够执行调度程序工作。谢谢
  • 在 Base SAS 中,当您有一个 .sas 文件以及在您批量提交时可以使用的代码后,您可以使用 Win 调度程序对其进行调度。所以 Win 调度程序会运行类似C:\Program Files\...\sas.exe -sysin "C:\....\MyProgram.sas" 的东西。或 .bat 文件或任何脚本。

标签: sas


【解决方案1】:

我建议使用其他一些计时过程的方法。 (如 cron tabs 或 Jenkins)

但是这里有一些可能有用的东西。

%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;

【讨论】:

  • 感谢您的帮助:)
猜你喜欢
  • 1970-01-01
  • 2014-07-25
  • 1970-01-01
  • 2013-06-13
  • 1970-01-01
  • 2019-07-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多