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

sas-innovate-white.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.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

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
  • 13562 views
  • 0 likes
  • 6 in conversation