data want;
set have;
if cmiss(of var_1-var_20)=19 and whichc('A10',of var_1-var_20)>0 then dummy=1;
else dummy=0;
run;
It may be that you are making your programming work difficult by creating a wide data set; in many cases creating a long data set with the same data is a lot easier to handle and program. Why? Because most SAS Procs are designed to work with long data sets. I urge you to explain the background of this problem, and what you are planning to do next once you have this dummy variable, so that we can advise further. We need to understand the big picture, not the tiny details of how to create the dummy variable.
--
Paige Miller