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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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