BookmarkSubscribeRSS Feed
fredbell
Fluorite | Level 6
Hi Reeza

If needed how can i convert it back to character so that i can say get the mean?

PROC SQL;
CREATE TABLE MEAN_Calls AS
SELECT date, MEAN(calls_handled)aS BPSMEAN
FROM mean1
group by date;
QUIT;

Above does not work, i'm assuming it is because the date is a number.

Fred This worked

proc MEANS NOPRINT data=mean1;
class date;
var calls_handled;
output out=new2 mean=calls_handled;
run;


Message was edited by: fredbell
Reeza
Super User
that should work. I need the log error to help debug. One suggestion would be to separate the as from the ) and possibly get the date as a 'date' rather than datetime (which is what i think you had it before).

PROC SQL;
CREATE TABLE MEAN_Calls AS
SELECT datepart(date) as grouped_date, avg(calls_handled) AS BPSMEAN
FROM mean1
group by datepart(date);
QUIT; Message was edited by: Reeza

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 16 replies
  • 14428 views
  • 0 likes
  • 6 in conversation