BookmarkSubscribeRSS Feed
ActuaryJo
Calcite | Level 5

This program (in the eLearning course) is supposed to produce an excel workbook with three Detail tabs and the Season should be 2014, 2015, 2016. This is true when I run the SAS report, but the excel sheet headings are 2014, 2014, 2014 (see screenshot). I even tried running the solution and it was still incorrect. I am running this in SAS EG 7.1  with SAS 9.4 (9.0401M2). I'm not sure what the problem is, it may be an update is needed? The data is correct, just the headings are wrong.

Thank you.

 

p106p01.sas:

---------------------------------------------------------

ods excel file="&outpath/StormStats.xlsx"
style=snow
options(sheet_name='South Pacific Summary');
ods noproctitle;

proc means data=pg1.storm_detail maxdec=0 median max;
class Season;
var Wind;
where Basin='SP' and Season in (2014,2015,2016);
run;

ods excel options(sheet_name='Detail');

proc print data=pg1.storm_detail noobs;
where Basin='SP' and Season in (2014,2015,2016);
by Season;
run;

ods excel close;
ods proctitle;

 

3 REPLIES 3
JBailey
Barite | Level 11

Hi @ActuaryJo

 

I just ran the solution and it worked fine for me. Perhaps restarting your SAS session will help.

 

Best wishes,

Jeff

@JBailey

ActuaryJo
Calcite | Level 5

Hi!

 

I tried it several different times to see if it was just a fluke, it doesn't seem to be the session. It produces the correct Season headers in the SAS report, just not in the excel. The code I posted is the solution, so I'm not surprised it works. A friend going through the course with me is using the University Edition and has no problem either.

 

I appreciate the suggestion though, worth trying for sure!

Panagiotis
SAS Employee

Hm that is weird. I took your code and tested it and it works for me. I even check the first few rows for each year in your workbook and they look accurate. The by statement in the frequency procedures is working. Why your titles aren't changing I am not sure of yet.

 

 

Do me a favor and check your SAS output not the Excel file. How does it look in your results tab? You should see the year breaks like this:

 

test.png

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2709 views
  • 0 likes
  • 3 in conversation