DATA songs;
INFILE "c:\MyRawData\KBRK.dat";
INPUT City $ Age wj kt tr filp ttr;
ARRAY song (5) wj kt tr filp ttr;
DO i = 1 TO 5;
IF song(i) = 9 THEN song(i) = .;
END;
RUN;
PROC PRINT DATA = songs;
TITLE 'KBRK Song Survey';
RUN;
文件KBRK.dat的数据如下:
Albany 54 3 9 4 4 9
Richmond 33 2 9 3 3 3
Oakland 27 3 9 4 2 3
Richmond 41 3 5 4 5 5
Berkeley 18 4 4 9 3 2
运行的结果如下:
请问为什么 i 的值是6而不是5呢?