1

此代码将成为 SAS 数据集成工作室中流程的一部分。

我想实现类似:

%macro conditional_start();

%let check_condition = 0;

%if check_condition eq 0 %then %do;

    %send_email_that_condition_has_been_met(); /* this I have made */

    /*Below run some kind of built-in macro probably, to stop execution of the whole code below */


%end;

%mend;

/*More macros end code I don't want to execute*/

我不能在大的“if”语句中打包下面的所有内容,因为它们是内置在块中的。

可能吗?

提前致谢!!

4

1 回答 1

1

您是否尝试将代码放入工作属性的“预编码”(保持宏打开)和“邮政编码”(宏的其余部分)部分?例如:

预编码:

%macro the_whole_job();

邮政编码:

%mend the_whole_job;

%macro conditional_start();
    %let check_condition = 0;
    %if check_condition eq 0 %then %do;
         %send_email_that_condition_has_been_met(); /* this You have made */
         /*do some kind of built-in macro meaning failure, not executing the whole code above*/
    %end;
    %else %do;
         %the_whole_job;
    %end; 
%mend;
于 2019-03-12T16:48:51.127 回答