I won't bother with the data you posted as an attachment, but this is a good situation for running a proc freq on a subset of the original data, and then running a proc freq and the results of the first proc freq:
proc freq data=myhlib_d3.nb_deces noprint;
where new_deaths>=1;
table date*iso_code / out=need (keep=iso_code date);
run;
proc freq data=need;
tables iso_code /out=want (keep=iso_code count);
run;
Note that the WHERE filter can be applied in the first proc freq, so you don't need to run a preparatory DATA step.
The first proc freq writes an output dataset NEED. It would ordinarily have 4 variables: iso_code date count and percent. But you only need the iso_code and date variables.
Then the second proc freq is applied to dataset need, giving a frequency of each iso_code, i.e. then number of unique date values encountered per iso_code.
This is a good example of using the power of various proc's instead of data step programming.
... View more