Rick,
You are correct. I never realize would have this kind of problem in sas.
Here is my corrected code after add "where=(col1=1)"

%let dsn=sashelp.heart;

proc transpose data=&dsn(obs=0) out=temp;
var _all_;
run;

proc sql noprint;
select catx(' ','missing(',_name_,') as ',_name_)
into :names separated by ','
from temp;
select _name_ into :vars separated by ' '
from temp;
create table want as
select &names. from &dsn;
quit;

data want;
set want;
_obs+1;
run;

proc transpose data=want out=want2;
by _obs;
var &vars.;
run;

data dattrmap;
input id $ value fillcolor $;
cards;
id 0 white
id 1 black
;

proc sgplot data=want2(where=(col1=1)) dattrmap=dattrmap;
heatmapparm x=_name_ y=_obs colorgroup=col1/x2axis attrid=id;
yaxis reverse integer ;
x2axis type=discrete tickstyle=inbetween display=(nolabel);
run;