SAS PROC SQL Error while computing averages
<p>I'm trying to compute <strong>annual averages and standard deviations of max and min temperatures,</strong>. My code is as follows:</p>

<pre><code> PROC SQL;
 create table new2 as
  select date,SUM(max_temp) as max_temp,SUM(min_temp) as min_temp,
 SUM(precip) as precip
   from WORK.ROCH_DATA 
    group by date;

 create table average2 as 
  select year(date) as year,(date) as year2,avg(max_temp) as maxavg,
avg(min_temp) as minavg, avg(precip) as avgprecip, std(max_temp) as
stdmaxtemp,
  std(min_temp) as stdmintemp,std(precip) as stdprecip
   from new2
    group by year;
 QUIT;
</code></pre>

<p>My code ends up spitting something on the likes of this; </p>

<p><a href="https://i.stack.imgur.com/A1gY2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A1gY2.png" alt="enter image description here"></a></p>

<p>It repeats the year2 and year column (I only want one with the proper year ie 1916.1917) and keeps recalculating a single year. How do i just get it to show me the single calculations of the 50 years in my data? (ie exclude the recalculations)</p>