Your descriptions are confusing.
If you want to count the total number of SAMPLES then you want to sum both ways. Order should not matter.
So assuming that the values of the SAMPLE_n variables represents the number of test done on each sample you could use the SAS function SUM(,) to add the values in each observation and then the SQL aggregate function SUM() to find the grand total across all observations.
proc sql;
select sum( sum(sample_1,sample_2,sample_3_sample_4)) as grand_count
from count
;
quit;
But since the values you show are only 1 or 0 perhaps the SAMPLE_n variables indicate whether or not any samples were taken? (If so then why was the dataset named COUNT??) And perhaps what you want to find out is how many observations had ANY samples taken? In that case for boolean 1/0 variables the MAX() will indicate if any of them was true or not.
In that case you might want to do something like this using the SAS function MAX(,) and then the SQL function SUM().
proc sql
select sum(max(sample_1,sample_2,sample_3,sample_4))
as nvisits label='Number of visits with any samples'
from count;
quit;
... View more