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
Can you please advise how one can output the contents of the PDV for each iteration as one steps through a SAS Program in order to validate the logic on a test case?
data _null_;
set sashelp.class;
where sex = "M";
put name= age= sex=;
run;
/* on log
Name=Alfred Age=14 Sex=M
Name=Henry Age=14 Sex=M
Name=James Age=12 Sex=M
Name=Jeffrey Age=13 Sex=M
Name=John Age=12 Sex=M
Name=Philip Age=16 Sex=M
Name=Robert Age=12 Sex=M
Name=Ronald Age=15 Sex=M
Name=Thomas Age=11 Sex=M
Name=William Age=15 Sex=M
*/
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.