The SAS System

The FREQ Procedure
 
Summary Statistics for B by C
Controlling for A

Cochran's Q, for A by B by C
Chi-Square DF Pr > ChiSq
8.4706 2 0.0145