SAS中文论坛

标题: 请教几个SAS题目 [打印本页]

作者: shiyiming    时间: 2010-7-26 16:16
标题: 请教几个SAS题目
The SAS data set WORK.TEMP is indexed  
  on the variable Id:   
   Id  Amount  
  --  ------  
  P     52   
  P     45   
  A     13   
  A     56   
  R     34   
  R     12   
  R     78   
   The following SAS program is submitted:
   proc print data=WORK.TEMP;   
     [_insert_BY_statement_]   
  run;
   Which BY statement completes the program,   
  creates a listing report that is grouped     
  by Id, and completes without errors?   
        A.
by Id;
      B.
by Id grouped;
      C.
by Id descending;      
     D.
by descending Id;      

在SAS中建立该数据集,运行一下,发现没有一个不报错的! 这是为何? 正确答案应该是那个? 谢谢!
作者: shiyiming    时间: 2010-7-26 16:53
标题: Re: 请教几个SAS题目
没报错呀
[code:2tml8xzz]data temp(index=(id));
        input Id $ Amount;
datalines;
P 52
P 45
A 13
A 56
R 34
R 12
R 78
;
proc print data=work.temp;
        by id;
run; [/code:2tml8xzz]
作者: shiyiming    时间: 2010-7-26 17:00
标题: Re: 请教几个SAS题目
晕 忘了建立索引了 谢谢!
作者: shiyiming    时间: 2012-7-11 11:13
标题: Re: 请教几个SAS题目
data temp(index=(id));
index原来是这么个用法,id两边也要叫括号!!!




欢迎光临 SAS中文论坛 (http://www.mysas.net/forum/) Powered by Discuz! X3.2