Search notes:

SAS: proc report - running total

Using the compute block to create a running total in a report:
data tq84_dat;
     do i = 1 to 10;
        output;
     end;
run;


proc report
     nowindows
     data = tq84_dat;

     columns i running_total;

     define i             / display;
     define running_total / computed;

     compute before;
       cum_tot = 0;
     endcomp;

     compute running_total;
          cum_tot = cum_tot + i;
          running_total = cum_tot;
     endcomp;
run;
Github repository about-SAS, path: /programming/proc/report/running-total.sas

See also

proc report

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Companie...', 1759383049, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Companies-Products/SAS/programming/proc/report/running-total(62): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78