由买买提看人间百态

topics

全部话题 - 话题: numhos
(共0页)
o******6
发帖数: 538
1
来自主题: Statistics版 - [合集] what's wrong with my codes?
☆─────────────────────────────────────☆
liuyali (dilly) 于 (Tue Mar 11 04:03:43 2008) 提到:
data a;
input id x1-x3 y1-y3 numhos;
cards;
1 1 2 3 4 4 4 3
2 1 2 3 4 5 6 3
;run;
data b;
set a;
array x x1-x3;
array y y1-y3;
do i=1 to numhos;
if y(i)=y(i+1) then put x(i) ' ' y(i) ' ' x(i+1) ' ' y(i+1);
if y(i)~=y(i+1) then do;y(i)=y(i)-1;
end;
end;run;
I know that when numhos=3, i+1=4, this is not right. But at least, sas
should create dataset.
Anyone has idea?
thanks
☆──────────────────────────────
(共0页)