Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Sentry Page Protection
Please Wait...
** Question 1 **;

proc freq data=order order=freq;
table product;
where time <= '11:00:00't;
run;

** Sausage roll is the best-selling product before 11 am.


** Question 2 **;
​

data example;
input date1 : date9. date2 : mmddyy10. date3 : ddmmyy10.;
format date1 date9. date2 mmddyy10. date3 ddmmyy10.;
datalines;
15NOV2018 11/15/2018 15/11/2018
;
run;


** Question 3 **;

proc sql;
select count(*) as cnt
from gym
where year(join_date) =2018;
run;

** Answer: 91 customers joined the gym in 2018. **;



** Question 4 **;

data gym2;
set gym;
if join_time < '12:00't then flag = "Morn";
else flag = "Aftn";
run;

proc freq data=gym2;
table flag;
run;

** More people joined the gym in the afternoon (217) than in the morning (83). **;



** Question 5 **;

data gym3;
set gym;
if status = "Cancelled" then num_month = intck('month', join_date, end_date, 'cont');
run;

proc means data=gym3;
var num_month;
run;

** On average, memberships last for 11 months. **;
Next
Already a member? Go to member's area.