I see what you mean. The datasets @lopezr and I produced (using hardcoded numbers of observations like 26 and 4) were just to demonstrate that the McNemar test involving zero cells can be performed without having summary data. Of course, I would not recommend creating detail data from existing summary data for this purpose, let alone using hardcoded numbers. (The required zero-weight observation could have been appended without knowing these numbers.)
Please note that your PROC MEANS approach (using the COMPLETETYPES option) would not have worked in the situation of the other thread you referred to in your original post: There the problem was that the value VIEW1='Failure' did not occur in the initial dataset. COMPLETETYPES would not add it. Instead, the CLASSDATA= option could have been used (or a preloaded format), as shown below.
/* Create test data for demonstration */
data have;
view1='Success';
do _n_=1 to 26;
view2=view1;
output;
end;
do _n_=1 to 4;
view2='Failure';
output;
end;
run;
/* Create a class dataset in order to introduce the non-existing level of VIEW1 */
data cldat;
view1='Failure';
view2=view1;
run; /* A more general version of CLDAT could contain all four
combinations of 'Success' and 'Failure'. */
/* Produce input dataset for PROC FREQ */
proc summary data=have classdata=cldat nway;
class view1 view2;
output out=want;
run;
/* Perform the desired McNemar test */
proc freq data = want;
weight _freq_ / zeros;
tables view1*view2 / agree;
exact mcnem;
run;
... View more