79637563

Date: 2025-05-25 10:18:36
Score: 1
Natty:
Report link

I think that the count function does what you are looking for:

*Replicate data;

data dt;
infile cards dlm = ",";
length stat $30;
input stat;
cards;
Closed Open Open,
Closed Closed Open,
Open,
Open,
;
run;

*Compute countOpen using count;

data dt2;
set dt;
countOpen = count(stat, "Open");
run;

proc print data = dt2;
run;

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Luigi