我使用 if 语句创建一个新变量,但不起作用。我环顾四周,找不到问题出在哪里。
data sockeye;
infile 'c:/sockeye.csv';
length data $8.;
input data $ sockeye;
if data='29-Jul' then sampweight =250/15;
if data='30-Jul' then sampweight =250/15;
run;
data n_boats;
length data$8.;
data = '29-Jul';_total_=250;output;
data = '30-Jul';_total_=250;output;
run;
proc surveymeans data=sockeye N=n_boats mean sum;
strata data / list;
var sockeye;
weight sampweight;
run;