if first.product then do;
cum_active=0;
cum_default=0;
end;
This is Initializing variables to be used for the sum statement.
cum_active+active;
cum_default+Default;
Thereafter, the total is calculated.
For more information on the sum statement,
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1dfiqj146yi2cn1maeju9wo7ijs.htm
First data step variables are described here https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/n01a08zkzy5igbn173zjz82zsi1s.htm
Also, I have a few requests. Please do not post the text mixed in with the code block as it makes it difficult to see. Also, if necessary, please make questions that you have already posted resolved.
... View more