Another way is by using proc transpose and proc freq shown as below: data exam; input regno $ exam $ c $; datalines; 111 AA Pass 111 BB Pass 222 AA Pass 222 BB Fail 333 AA Fail 333 BB Pass 444 AA Pass 444 BB Pass 555 AA Fail 555 BB Fail 666 AA Fail 666 BB Pass 777 AA Pass 777 BB Fail 888 AA Fail 888 BB Pass 999 AA Pass 999 BB Pass 123 AA Fail 123 BB Pass ; run; proc sort data=exam; by regno; run; proc transpose data=exam out=temp; by regno; id exam; var c; run; data temp1; set temp; result=catx('-',AA,BB); run; proc freq; table result; run;
... View more