Dear All, I have searched the forum for the answer, but could not find something relevant to my query. I have daily average data for two variables – the dataset keeps updating on daily basis (connected to live data source). For the calculation of a parameter, I need to get the average of both the variables, get their ratio and calculate the percentage increase or decrease over the period of year (also given as formula as follows). I know that I need to setup Macro but how should it be? My questions are: How to convert daily average to yearly average for the variables in SAS Code? I want to have the macro, which automatically separates each year and calculate the average for the variables (as data flows)? var1_avg_year123 = 123.456 var2_avg_year123 = 234.567 Indicator_year123 = var1_avg_year123 / var2_avg_year123 2. The calculated average is then used in given formula to calculate the percentage change in the Performance Indicator. Perf_Indicator(%) = ( Indicator_current_year – Indicator_last_year) / (Indicator_current_year) * 100 My question is, any clues about the solution, to have this kind of Macro? Thanks, Sample of data: Date Var1 Var2 1/4/2018 1052.361 1316.885 1/5/2018 1213.219 1733.21 1/6/2018 978.2041 1422.348 1/7/2018 680.1459 945.5225 1/8/2018 456.6003 617.2773 1/9/2018 150.2401 194.8029 1/10/2018 677.037 860.5974 1/11/2018 1469.71 1948.627 1/12/2018 1179.192 1552.934 1/13/2018 1298.249 1669.028 1/14/2018 1358.477 1603.955 1/15/2018 1221.706 1335.553 1/16/2018 1454.211 1362.172 1/17/2018 1721.99 1774.3 1/18/2018 1689.863 2157.368 1/19/2018 1040.45 1537.941 1/20/2018 859.5139 1232.655 1/21/2018 1426.132 2046.319 1/22/2018 938.5096 1365.816 1/23/2018 1457.251 2025.362 1/24/2018 881.5562 1198.344 1/25/2018 1480.552 1961.99 1/26/2018 1926.771 2479.684 1/27/2018 1916.55 2461.287 1/28/2018 1673.023 2225.212 1/29/2018 1765.874 2462.233 1/30/2018 1789.701 2533.19 1/31/2018 1676.445 2443.382 2/1/2018 1800.134 2418.202 2/2/2018 1921.747 2369.32 2/3/2018 2066.464 2468.181 2/4/2018 1959.351 2477.953 2/5/2018 1807.281 2434.835 2/6/2018 1601.57 2421.839 2/7/2018 1510.655 2424.343 2/8/2018 1605.063 2420.206 2/9/2018 1771.467 2414.867 2/10/2018 1929.182 2409.557 2/11/2018 1985.056 2441.965 2/12/2018 1907.433 2476.812 2/13/2018 1795.833 2494.92 2/14/2018 1858.474 2568.475 2/15/2018 1732.217 2672.946 2/16/2018 1729.425 2631.901 2/17/2018 1787.801 2611.558 2/18/2018 2054.658 2603.725 2/19/2018 2076.014 2589.475 2/20/2018 1895.95 2561.175 2/21/2018 1718.748 2509.298 2/22/2018 1751.495 2441.274 2/23/2018 1842.372 2366.673 2/24/2018 1805.444 2132.074 2/25/2018 1505.642 1904.716 2/26/2018 1396.847 1469.527 2/27/2018 1421.316 1704.773 2/28/2018 1714.233 2032.702 3/1/2018 1832.073 2150.518 3/2/2018 1932.319 2167.833 3/3/2018 1715.786 1861.284 3/4/2018 1458.251 1596.16 3/5/2018 1339.739 1611.28 3/6/2018 1410.955 1642.457 3/7/2018 1413.319 1791.306 3/8/2018 1509.37 1801.486 3/9/2018 1459.795 1757.712 3/10/2018 1472.163 1725.644 3/11/2018 1659.859 1656.797 3/12/2018 2004.291 1639.147 3/13/2018 1956.614 1617.089 3/14/2018 1694.647 1580.816 3/15/2018 1606.138 1611.78 3/16/2018 1603.294 1603.493 3/17/2018 1514.116 1576.456 3/18/2018 1368.427 1526.759 3/19/2018 1196.518 1511.448 3/20/2018 1215.701 1513.986 3/21/2018 1106.108 1360.411 3/22/2018 1363.992 1575.326 3/23/2018 1337.306 1697.756 3/24/2018 1260.276 1617.235 3/25/2018 1381.319 1691.405 3/26/2018 1483.169 1704.757 3/27/2018 1314.011 1637.299 3/28/2018 1477.24 1872.673 3/29/2018 1597.64 1957.048 3/30/2018 1674.141 1972.857 3/31/2018 1383.66 1674.452 4/1/2018 1379.385 1770.248 4/2/2018 1569.761 2275.148 4/3/2018 1474.417 2171.795 4/4/2018 1376.228 2210.642 4/5/2018 949.9828 1510.065 4/6/2018 1246.785 1886.985 4/7/2018 1138.834 1793.173 4/8/2018 1383.181 2248.09 4/9/2018 1365.797 2199.225 4/10/2018 1546.395 2403.06 4/11/2018 1383.692 2048.077 4/12/2018 1680.016 2285.013 4/13/2018 1775.622 2572.279 4/14/2018 1577.264 2345.104 4/15/2018 1423.98 2041.661 4/16/2018 1780.363 2149.781 4/17/2018 1466.3 1697.889 4/18/2018 80.1146 111.1365
... View more