Huh? The proposed structure seems strange as two of the columns are constants.
proc transpose data=have out=want(drop=_name_) suffix=_grade;
by id;
id participation;
var grade ;
run;
If you want to have those two other columns to indicate if there is a grade for that type of participation then perhaps you want to add it afterwards? Might be better to use 0/1 instead of 'active' as the value of that indicator.
data want2;
set want;
notactive_ind=not missing(notactive_grade);
active_ind=not missing(active_grade);
run;
Notactive_ active_ notactive_ active_
Obs Id grade grade ind ind
1 54 a b 1 1
2 55 c d 1 1
3 56 c 1 0
4 57 d 0 1