foocares 發(fā)表于 2017-4-18 14:54
如上文所言,整理原始數(shù)據(jù)很重要,比如看了你的數(shù)據(jù)后我知道你開始計(jì)數(shù)的年份是從78年開始,到06年結(jié)束。
...
data test;
set hw5(drop = eventid name location newdate2str location1);
array myar(*) F8 - F36;
startyear =1978;
endyear =2006;
if start < startyear then start = startyear;
start_idx = start - startyear + 1;
if end > endyear then end = endyear;
end_idx = end - startyear + 1;
do i = start_idx to end_idx;
total+myar(i);
end;
put total=;
run;
是不是do語(yǔ)句有問(wèn)題?