如何在任何列表中设置今天的宏观条件

发布于 2025-01-16 10:00:51 字数 155 浏览 2 评论 0原文

我想将代码设置为每月 5,11,16,22,28 天运行,但它不起作用。

%if %sysfunc(day(%sysfunc(today()))) in (5,11,16,22,28) %then %do

我该如何修复它?非常感谢。

I wanna set the code run at days: 5,11,16,22,28 monthly but it doesn't work.

%if %sysfunc(day(%sysfunc(today()))) in (5,11,16,22,28) %then %do

How can I fix it? Thanks much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吾性傲以野 2025-01-23 10:00:51

IN 运算符在 SAS 9.2 宏中工作,但您需要定义系统选项。必须打开 MINOPERATOR(Macro-In-Operator),并且在您的情况下,还必须指定 MINDELILITER,因为您使用的是逗号分隔值。
更多信息请参阅让 IN 运算符在 SAS® 宏中运行< /a>

options minoperator mindelimiter=',';
%if %sysfunc(day(%sysfunc(today())-1)) in (5,11,16,22,28) %then %do;
    %put do smth...;
%end; 

do smth...

请注意上面示例中的 -1 来复制 3 月 22 日。

The IN operator works in a SAS 9.2 Macro but you need to define system options. The MINOPERATOR (Macro-In-Operator) must be turned on and in your case, the MINDELILITER too must be specified as you are using comma delimited values.
More information can be found in Getting the IN operator to FUNCTION inside a SAS® Macro

options minoperator mindelimiter=',';
%if %sysfunc(day(%sysfunc(today())-1)) in (5,11,16,22,28) %then %do;
    %put do smth...;
%end; 

do smth...

Notice the -1 in the above example to replicate March 22.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文