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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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