對應 SAS Base 123 題 --Q 93
- id: 定義輸出時標識某一列為obs 觀測值標簽,可以理解為用某一列的數(shù)值代替 1,2,3 (最左側(cè))的觀測標識。
- by 以某一列g(shù)roup 分組標識
- var 指明打印的變量,可以存在與id 相同的列,與id 重復則重復輸出。
數(shù)據(jù)集.png
用id , by ,id+by 做個實驗:
id:
proc print data = test_db.repotest1 ;
id x;
var y z1 ;
run;
-
output 結(jié)果
image.png
by:
proc print data = test_db.repotest1 ;
by x;
var x y z1 ;
run;
image.png
by + id
proc print data = test_db.repotest1 ;
by x;
id x;
var y z1 ;
run;
image.png