g jvar = Cay+Caz
drop Cay Caz
reshape wide Cbx, i(ID) j(jvar) string
This will not create columns for values of jvar that do not exist in
the data (e.g. bx, by). If you want to do that, add dummy
observations for ID=1 with Cay=b, Caz=x and Cay=b, Caz=y before
executing the code above.