SAS solution is not to use PROC SQL for such a thing. SQL is always going to be a bit slower or harder/messier to code with exceptions (without the NotTypeA this would be easier). In SAS, PROC TABULATE and PROC FORMAT will give you that easily with a quick transpose afterwards. A bit more code but a lot more flexible.
data have;
input Id Type $;
datalines;
1 A
2 B
3 C
4 A
;;;;
run;
proc format lib=work;
value $typeF (multilabel notsorted)
'A'='TypeA'
'B'='TypeB'
'C'='TypeC'
'B','C'='NonTypeA'
;;;;
run;
proc tabulate data=have out=want;
format type $typef.;
class type/mlf preloadfmt order=data;
tables type*n;
run;
proc transpose data=want out=want_t(drop=_NAME_);
var N;
id type;
run;