Since you are looking at "any yes" and "all no"
I might be tempted to do it this way: (Untested as data step to create your example data not provided)
temp= catx(',', of val[*]);
if findw(temp,'Yes')>0 then Impacted_patch='Yes';
else if findw(temp,'No')>0 then Impacted_patch='No';
drop temp;
Note that the above code will set NO for records involving combinations of Deferred and only No or missing and set missing if the only value is Deferred.
You could use the function call that creates temp instead of the variable temp but this way if you can leave temp in while debugging
This is also a good example of why coding character Yes No values is poor. If you had them as numeric yes=1 and no=yes
Impacted_patch = ifc(sum(of val[*]),1,0,.);
/* of if you insist Impacted_patch must be character*/
Impacted_patch = ifc(sum(of val[*]),'Yes','No','');
Of course neither of these address "deferred" as you provided no rule for what to do if only that value occurs, or occurs in combination with all other NO or blank.
... View more