在SAS中使用set语句执行until / while

时间:2017-08-12 20:32:33

标签: loops sas do-while

我正在寻找一个例子,直到/使用set语句,除了Dow循环,如下所示。

data want;
  set have;
    do until/while (exit criteria);
     * some SAS statements;
    end;
run;

我最初尝试过这个。

data test;
  input x;
  cards;
  1
  2
  3
  4
  ;
 run;

data test2;
   set test;
     count = 0;
       do until (count >= 3);
         y = x + count;
         count + 1 ;
        output;
       end;
  run;

1 个答案:

答案 0 :(得分:1)

data whatdidyoutry;
  set sashelp.class;
  f=2;
  wt=1;
  do until (wt=f);
    wt+1;
    output;
  end;
run;