Syntax, HAVING clause:
PROC SQL <options>;
SELECT column-1 <,...column-n>
FROM input-tables
WHERE expression
GROUP
BY column-name <,column-name>
HAVING expression;
QUIT;
expression
produces a value from
a sequence of operands and operators.
|
proc sql;
select jobcode, avg(salary) as AvgSalary format=dollar11.2
from certadv.payrollmaster
group by jobcode
having avg(salary)>56000;
quit;
having AvgSalary > 56000
proc sql; select empid, salary,(salary/sum(salary)) as Percent format=percent8.2 from certadv.payrollmaster where jobcode contains 'NA'; quit;
NOTE: The query requires remerging summary statistics back with the original data.