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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 12341 views
  • 0 likes
  • 6 in conversation