I need to create a table such as this:
August 2018 | August 2017 | August 2018 5 yr avg | August 2018 10 yr avg | August 2018 20 yr avg | |
Days at/or Above 90° | 28 | 25 | 24 | 26 | 24 |
Days at/or Above 100° | 8 | 0 | 4 | 6 | 4 |
CDD | 630 | 516 | 547 | 579 | 545 |
However, using the code below, this is the result I've been able to produce so far:
August 2018 Weather Data | |||
01AUG18 | 01AUG17 | ||
Max_Temp_90 | 28 | 25 | |
Max_Temp_100 | 8 | 0 | |
CDD | 630 | 516 |
TITLE1 "August 2018 Weather Data";
PROC TABULATE
DATA=WORK.AUG_YEARLY_TEMPS_CDD_AVGS
OUT=WORK.'AUG SUMMARY TABLES'n(LABEL="Summary Tables for WORK.AUG_YEARLY_TEMPS_CDD_AVGS")
FORMAT=BESTX7.;
VAR Max_Temp_90 Max_Temp_100 CDD;
CLASS date / ORDER=UNFORMATTED MISSING DESCEND ;
TABLE
/* ROW Statement */
(Max_Temp_90 * Sum=' ' Max_Temp_100 * Sum=' ' CDD * Sum=' ' ),
/* COLUMN Statement */
date=' ' ;
;
RUN;
How do I manipulate/transpose the August 2018 5, 10, and 20 year averages data to add them as columns for Days at/over 90, Days at/over 100, and CDD as shown above?
I have attached my data.
@KALLEN wrote:
I have attached my data.
Excel-files aren't helpful, please add the data you have as data-step using datalines-statement, so that we see what you have after the excel-file was read. Excel in general is poor choice for storing and transporting data.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.