對應(yīng) SAS Base 123 題 --Q 93
- id: 定義輸出時(shí)標(biāo)識某一列為obs 觀測值標(biāo)簽,可以理解為用某一列的數(shù)值代替 1,2,3 (最左側(cè))的觀測標(biāo)識。
- by 以某一列g(shù)roup 分組標(biāo)識
- var 指明打印的變量,可以存在與id 相同的列,與id 重復(fù)則重復(fù)輸出。

數(shù)據(jù)集.png
用id , by ,id+by 做個(gè)實(shí)驗(yàn):
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
