Is this the query you suggest? (Table2 has 2 columns that Table1 doesn't have them)
proc sql;
create table work.Table2 as
(Select distinct
a.Name,
a.Age,
a.Enrolled,
Red,
Blue
from work.Table1 a join work.Table1 a
if a.Color = 'red' then Red = 'red'
else (if a.Color = 'blue' then Blue = 'blue') end if );
quit;
... View more