I am looking to convert a table like the one below...
into the following table. So, turn the count into a running total for each section.
Can you provide some test data in the form of a datastep, as your data is before. I don't see why you only have number at certain points. I mean you could do retain, however, why do you only have some numbers, it may be easier to change the way count is added to the dataset rather than retain them afterwards.
data want (drop=oldcount);
set have (rename=(count=oldcount));
if first.section then count = 0;
if oldcount ne . then count=oldcount;
Edit: Replaced zero with dot in second if condition
Post updated: Kurt Bremser
Looks like a common LOCF problem to me.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.