考了70题中的3, 6, 9, 11, 15, 16, 17, 20, 21, 27, 28, 32, 34, 35,37, 40, 42, 43,44,45, 48,52,56,57,58,60,61,62,63,65,67,69,70
1. ODS CSVALL FILE='filename.csv';
… SAS code …
ODS CSVALL CLOSE; PDF
2. ods html file=“ xx”
proc print data=xx
proc freq xx
问output几个, 我选2个
3. 选择有几个variable 的命名正确,其中有两个是数字开头,错误,所以答案是2
4. total=total+? 然后输出里有一列total应该全为missingvalue,因为total未赋初
始值
5. 题43 的变形题ship_date 变为char,input 和put的转换问题,由于月份全拼出来了,日期变character的 答案是PUT(date, worddate20.)
6.
we want to wrap the label AAAA*BBBB,选哪个?split(*)
7.
If _N_=1, then total=0; else total=(A+B); 答案是total 第一个值为零,其他为A+B
8. data test1;
set test2 end=eof;
input var1;
var1=eof;
run;
问var1 值是多少? 1
9. data new;
Amount =4;
If Amount=4
then word="FOUR";
If Amount=7
then word="Seven";
Else if word="None!!!";
Amount=7;
run;
10. 每年人口以2%速度增长,要输出2012年到2021年的所有结果。除了doyear=2012 to 2021 还要在end 前加output才能保证每年都有
11. Sort by 填空: ascending expenses withinEmplyID;
12. 排序里面by variable1 variable2 descendingdate variable4;答案是descending只作用在紧跟其后的date
13. 有一个数据表叫temp1,里面有EmpID,Name, Dept. 有50个observation
还有一个数据表叫temp2, 里面有EmployeeID (注意这里变量名不一样), Name, Dept. 有4个observation然后程序是
data temp;
set temp1 temp2;
run;
问你set a b合并之后的新dataset有几个变量,答案是4个
14. 题57 的变形:显示结果为每个月中的第几天,而不是星期几。选项有day(),weekday(), getday(), DayofMonth()
15. 这题大家一定要记住! 要不上场看到死磕C跟D,像我一样
data WORK.NEW;
set WORK.OLD;
Count+1;
run;
The varaible Count is created using a sumstatement. Which statement regarding this variable is
true?
A. It is assigned a value 0 when the datastep begins execution.
B. It is assigned a value of missing whenthe data step begins execution.
C. It is assigned a value 0 at compiletime.
D. It is assigned a value of missing atcompile time.
Answer: C
16. 题42的变形题。填空题,给出Pos=find(‘USAustrilia....','US','i', 5) 的具体数值,答案是填5
17. by destination descending revenue;D. FRA 75962
18. Unless specified, which variables and datavalues are used to calculate statistics in
the MEANS procedure? non-missing numericvariable values only
19. if jobcode = 'Chem2',then description = 'SeniorChemist';
else description = 'Unknown';
考变量值的大小写有区别
20. length of the variable :SETstatement 在the LENGTH statement前面, SET statement起作用.
21. 题20考了format length , 在SET statement前面的话, format起作用。
22. 题35的变形题。果然最后一行变成了 else outputWORK.OTHER。答案是2 2 1
23. 题27 的变形题。By Day descending Month