BookmarkSubscribeRSS Feed
KALLEN
Obsidian | Level 7

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°2825242624
Days at/or Above 100°80464
CDD630516547579545

 

However, using the code below, this is the result I've been able to produce so far:

 

August 2018 Weather Data
    
 01AUG1801AUG17
Max_Temp_90 2825
Max_Temp_100 80
CDD 630516

 

 

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. 

 

1 REPLY 1
andreas_lds
Jade | Level 19

@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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1187 views
  • 1 like
  • 2 in conversation