From: Tom Abernathy on
Just change your input statement so that you are reading 16
observations per line of your raw file.
Then you can use PROC FREQ to get the counts.

data test2;
input good @;
do p=1 to 16;
input yes @;
output;
end;
datalines;
1 1 1 1 . 1 0 1 1 1 1 1 1 0 0 0 1
1 1 1 0 . 1 1 1 1 1 0 1 0 0 1 1 1
1 1 1 1 0 1 1 0 0 1 0 1 1 0 0 1 1
1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1
0 1 1 1 0 0 1 0 0 0 0 0 1 0 0 1 0
0 . . . . . 0 . . . . . . . . . .
1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1 1 0 1 1 0 1 0 1
0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 1 1
;
run;

proc freq data=test2;
tables good*p*yes / noprint missing out=want ;
run;
From: Patrick on
Hi

The code I've sent you would have worked (as it was tested). But now
looking at the raw data you provided: You would have to add a ID
(which is nothing else than a record count - ID=_N_) and then sort by
ID GOOD.

As you're reading raw data (and it's not an already existing SAS
dataset): Tom's approach is much more straight forward.

HTH
Patrick