OPTIONS LS=64 PS=60 NONUMBER NODATE; ***********************************; *** Using loops to read in data ***; ***********************************; **********************************; ** Example 1: Oneway ANOVA data **; **********************************; DATA oneway; INPUT trt $ @@; DO i=1 to 5; INPUT resp @@; OUTPUT; END; CARDS; A 21.1 22.3 21.9 20.9 22.2 B 25.6 25.1 24.9 24.4 26.0 C 23.3 23.6 22.9 23.9 23.2 ; PROC PRINT DATA=oneway; RUN; *******************************************; ** Example 2: Creating repeated measures **; ** data from individual data records **; *******************************************; DATA repmeas; ARRAY time(3) time1-time3; DO subj = 1 to 4; DO i = 1 TO 3; INPUT subjid _time time(i) @@; END; OUTPUT; END; CARDS; 1 1 45 1 2 46 1 3 55 2 1 41 2 2 42 2 3 50 3 1 32 3 2 36 3 3 41 4 1 51 4 2 53 4 3 60 PROC PRINT DATA=repmeas; DATA repmeas; SET repmeas; DROP subjid _time i; PROC PRINT DATA=repmeas; ID subj; RUN;