SAS 调用定义未分配 URL

SAS Call define is not assigning the URL

我正在尝试使用调用定义分配动态 URL,但它不起作用。 这是带有 URL 的初始 table。每个条目都有单独的 URL。

这是我的代码:

Data teams_link;
    set Teams;
    link = "https://www.google.com/";
run;

ods html;

Proc report data = teams_link;
    columns Team_A Team_B link;

    define Team_A /"Team A";
    define Team_B /"Team B";
    define link /"URL";

    compute Team_A;
        call define (_col_, 'url', link);
    endcomp;

    compute Team_B;
        call define (_col_, 'url', "https://www.google.com/");
    endcomp;

run;

结果如下:

URL 被分配给“B 队”,但没有分配给“A 队”。为什么会这样以及如何让它发挥作用?

到目前为止我尝试了什么:

我现在别无选择。

PROC REPORT 按照变量在 COLUMNS 语句中出现的顺序处理变量。因此,当 TEAM_A 的 COMPUTE 块运行时,LINK 的值是空的。

在 COLUMN 语句中将变量 LINK 移到 TEAM_A 之前。您可以使用别名多次引用同一个输入变量。您可以在额外的一个上使用 NOPRINT 以防止它打印。

proc report data = teams_link;
    columns link=link_a Team_A Team_B link;

    define link_a / noprint;
    define Team_A /"Team A";
    define Team_B /"Team B";
    define link /"URL";

    compute Team_A;
        call define (_col_, 'url', link_a);
    endcomp;

    compute Team_B;
        call define (_col_, 'url', "https://www.google.com/");
    endcomp;

run;