If your data include one customer has both NON_COE and COE rows, that would not be a problem, sas would generate two columns as you wanted.
But if your data include only NON_COE or COE row in each customer, that is another story, you need to pad both NON_COE and COE rows in it.
data have;
input customer flag $ count;
cards;
12345 NON_COE 2
12346 COE 5
;
data flag;
input flag $;
cards;
NON_COE
COE
;
proc sql;
create table have2 as
select a.*,coalesce(b.count,0) as count
from
(
select * from
(select distinct customer from have),
(select distinct flag from flag)
) as a natural left join have as b
;
quit;
proc transpose data=have2 out=want;
by customer;
var count;
id flag;
run;
... View more