楼主: mazhengjy
6974 6

问几道SAS Adv题目,望高手给以解答(已重新排版) [推广有奖]

  • 0关注
  • 1粉丝

已卖:1411份资源

硕士生

31%

还不是VIP/贵宾

-

威望
0
论坛币
3817 个
通用积分
5.3202
学术水平
2 点
热心指数
3 点
信用等级
2 点
经验
2403 点
帖子
98
精华
0
在线时间
201 小时
注册时间
2008-10-13
最后登录
2018-9-5

楼主
mazhengjy 发表于 2010-4-5 05:28:27 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币


Item 6 of 63 Mark item for review  

The table WORK.PILOTS contains the following data:

   WORK.PILOTS

   Id   Name     Jobcode  Salary
   ---  ------   -------  ------
   001  Albert   PT1       50000
   002  Brenda   PT1       70000
   003  Carl     PT1       60000
   004  Donna    PT2       80000
   005  Edward   PT2       90000
   006  Flora    PT3      100000

The data set was summarized to include average
salary based on jobcode:      

   Jobcode  Salary     Avg      
   -------  ------   -----      
   PT1       50000   60000      
   PT1       70000   60000      
   PT1       60000   60000      
   PT2       80000   85000      
   PT2       90000   85000      
   PT3      100000  100000      

Which SQL statement could NOT generate  
this result?


        A.
select
   Jobcode,   
   Salary,   
   avg(Salary) label='Avg'      
from WORK.PILOTS
group by Jobcode
order by Id   
;      

     B.
select
   Jobcode,   
   Salary,   
   (select avg(Salary)  
   from WORK.PILOTS as P1      
   where P1.Jobcode=P2.Jobcode) as Avg   
from WORK.PILOTS as P2  
order by Id   
;      

     C.
select
   Jobcode,   
   Salary,   
   (select avg(Salary)  
   from WORK.PILOTS     
   group by Jobcode) as Avg     
from WORK.PILOTS
order by Id   
;      

     D.
select
   Jobcode,   
   Salary,   
   Avg
from   
   WORK.PILOTS,
  (select     
      Jobcode as Jc,   
      avg(Salary) as Avg
   from WORK.PILOTS     
   group by 1)
where Jobcode=Jc
order by Id   
;      

Item 11 of 63 Mark item for review  

  The following SAS code is submitted:   

  data WORK.TEMP WORK.ERRORS / view=WORK.TEMP;
     infile RAWDATA;   
     input Xa Xb Xc;   
     if Xa=. then output WORK.ERRORS;   
     else output WORK.TEMP;     
  run;

Which of the following is true of the WORK.ERRORS data set?


A.        The data set is created when the DATA step is submitted.   
B.        The data set is created when the view TEMP is used in another SAS step.   
C.        The data set is not created because the DATA statement contains a syntax error.  
D.        The descriptor portion of WORK.ERRORS is created when the DATA step is submitted.  


Item 29 of 63 Mark item for review  

The following program is submitted to check the variables Xa, Xb, and Xc in the SASUSER.LOOK data set:  

   data _null_ WORK.BAD_DATA / view=WORK.BAD_DATA ;      
      set SASUSER.LOOK(keep=Xa Xb Xc);   
      length _Check_ $ 10 ;     
      if Xa=. then _check_=trim(_Check_)!!" Xa" ;
      if Xb=. then _check_=trim(_Check_)!!" Xb" ;
      if Xc=. then _check_=trim(_Check_)!!" Xc" ;
      put Xa= Xb= Xc= _check_= ;
   run ;      

  When is the PUT statement executed?   

A.        when the code is submitted      
B.        only when the WORK.BAD_DATA view is used
C.        both when the code is submitted and the view is used      
D.        never, the use of _null_ in a view is a syntax error      


Item 50 of 63 Mark item for review  

The table WORK.PILOTS contains the following data:

   Id   Name     Jobcode  Salary
   ---  ------   -------  ------
   001  Albert   PT1       50000
   002  Brenda   PT1       70000
   003  Carl     PT1       60000
   004  Donna    PT2       80000
   005  Edward   PT2       90000
   006  Flora    PT3      100000

A query was constructed to display the pilot salary means at each level of Jobcode and the difference to the overall mean salary:      

Jobcode    Average  Difference
------------------------------
PT1          60000      -15000
PT2          85000       10000
PT3         100000       25000

Which select statement could NOT have produced this output?  


        A.
select
   Jobcode,   
   avg(Salary) as Average,      
   calculated Average - Overall as difference  
from   
   WORK.PILOTS,
   (select avg(Salary) as Overall from WORK.PILOTS)
group by jobcode
;      

     B.
select
   Jobcode,   
   avg(Salary) as Average,      
   (select avg(Salary) from WORK.PILOTS) as Overall,      
   calculated Average - Overall as Difference  
from WORK.PILOTS
group by 1   
;      

     C.
select
   Jobcode,   
   Average,   
   Average-Overall as Difference
from   
   (select Jobcode, avg(Salary) as Average     
   from WORK.PILOTS     
   group by 1),
   (select avg(Salary) as Overall
   from WORK.PILOTS)   
;      

     D.
select
   Jobcode,   
   avg(Salary) as Average,      
   calculated Average-(select avg(Salary) from WORK.PILOTS)      
      as Difference     
from WORK.PILOTS
group by 1   
;      



Item 54 of 63 Mark item for review

The following SAS program is submitted:

%let Name1=Shoes;
%let Name2=Clothes;
%let Root=name;
%let Suffix=2;
%put &&&Root&Suffix;

What is written to the SAS log?

A.        &Name2
B.        Clothes
C.        &&&Root&Suffix
D.        WARNING: Apparent symbolic reference ROOT2 not resolved.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:constructed difference summarized following statement 高手 题目 SAS adv 给以

沙发
crackman 发表于 2010-4-5 09:59:11
第一题选C
自己可以去程序里面跑一下
主要原因是多重排序的问题吧

藤椅
crackman 发表于 2010-4-5 10:00:54
最后一道题是B
解析&的问题

板凳
crackman 发表于 2010-4-5 10:07:56
倒数第二题 B
原因很明显
AVERAGE 和OVERALL 都需要加 calculated

报纸
mazhengjy 发表于 2010-4-5 10:28:04
3# crackman
感谢解答,但是最后一题中的 &Name2 和 &name2 都能得出 Clothes的结果么? 首字母大写不会造成无法读取么?

地板
crackman 发表于 2010-4-5 10:35:32
在VARIABLE NAME里面不会影响 不区分大小写

7
condor_gz 在职认证  发表于 2015-3-5 19:27:23
第11题是这样的:
比如试着运行如下程序:
   data WORK.TEMP WORK.ERRORS / view=WORK.TEMP;
     set sasuser.drums;
     if hour=1 then output WORK.ERRORS;
     else output WORK.TEMP;
  run;
在仅仅通过F3执行后会发现,只在work下创建了一个名为temp的视图,视图中也没有观测。
当你双击该视图后,才写入观测,并创建了另一个名为Error的数据集。所以此处答案应选B。29题同理。
已有 1 人评分论坛币 收起 理由
admin_kefu + 50 热心帮助其他会员

总评分: 论坛币 + 50   查看全部评分

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-26 03:10