Please check this new variable retain issue ;

data template;
set sashelp.class;
stop;
run;
data class;
set sashelp.class;
drop height weight ;
run;

* this is NOT ok ;
data test;
if 0 then set template;
set class;
if sex='M' then height=2; /* it's not OK */
run;