title: Proc Report Compute
body: <p>I am learning proc report and wanted to make a simple report with a computed column.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>proc report data = schools nowd;  
      columns school class maths science total;  
      define school       / group;  
      define class        / display;  
      define maths        / analysis;  
      define science      / analysis;  
      define total        / computed;  
  
      compute total;  
          total = maths + science;  
      endcomp;
  
  run;
  </code></pre>
  
  <p>Here is the output which i am getting :</p>
  
  <pre><code>Schools   Class     Maths   Science      total  
  Airport    i            50         41          0  
  Airport    ii           92         53          0  
  Airport    iii          62         60          0  
  Airport    iv           66         61          0  
  Amrut      i            84         58          0  
  Amrut      ii           42         83          0  
  Amrut      iii          53         64          0  
  Amrut      iv           89        100          0  
  Asia       i            42         74          0  
  Asia       ii           48         91          0  
  Asia       iii          75         76          0  
  Asia       iv           46         84          0  
  </code></pre>
  
  <p>Can anyone please explain me why i am getting the value of total as 0. I believe it is possible to create a new column in PROC REPORT. What is it that i am doing wrong.</p>
  
  <p>Thanks and Regards<br>
  Amit</p>