PROGRAM
--------------------------------------
DATA SAMPLE ;
INPUT CAT RES ;
CARDS ;
1 10
1
9
1
9
1
8
1 10
2 20
2 21
2 21
2 20
2 20
;
RUN ;
*****************************************************
EXTRACTING SOME SUMMARIZED DATA TO
USE HAVING CLAUSE
*****************************************************;
PROC SQL ;
CREATE TABLE D4
AS SELECT CAT, MEAN(RES) AS RES_MEAN
FROM SAMPLE
GROUP BY CAT
HAVING MEAN(RES)>12 /*NOT USE
'RES_MEAN'. ONLY SHOW MEAN > 12.*/
;
QUIT ;
PROC PRINT; RUN ;
OUTPUT (ONLY when CAT=2)
Post a Comment
別ページに移動します