If I'm understanding what you want: sum some value across all rows in you table.
then I think this will work.
data example;
set example;
if _n_ = 1 then sum=0; *I do not think you need this line but I put in for example;
sum + height; increments sum by value of height;
run;
I'm not sure of what you are thinking about when you say use sum function over height column. The sum function works on columns in a single row ie
something like this.... sum = sum(ht1, ht2, ht3).
This syntax sums across rows. So when i = linescount, Height will be the sum of height over all lines.
You certainly can get more creative with what you increment - as you say some more complex calculation
for example : sum + (a + b*(c^2)*d/e); where a-e are all columns.
Hope this helps
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.