Features: |
CREATE VIEW statement GROUP BY clause SELECT clause : COUNT function HAVING clause |
Other features: |
AVG summary function data set option : PW= |
Table names: | PROCLIB.PAYROLL PROCLIB.JOBS |
libname proclib 'SAS-library';
proc sql; create view proclib.jobs(pw=red) as
select Jobcode, count(jobcode) as number label='Number',
avg(int((today()-birth)/365.25)) as avgage format=2. label='Average Age', avg(salary) as avgsal format=dollar8. label='Average Salary'
from payroll
group by jobcode having avgage ge 30;
title 'Current Summary Information for Each Job Category'; title2 'Average Age Greater Than or Equal to 30';
select * from proclib.jobs(pw=red);
title2;
avg(int((today()-birth)/365.25)) as avgage format=2. label='Average Age', avg(salary) as avgsal format=dollar8. label='Average Salary'
title 'Current Summary Information for Each Job Category'; title2 'Average Age Greater Than or Equal to 30';