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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: