SAS 这个机考太坑爹了,进入SYSTEM之后我就在屏幕前面等check in, 等了40分钟一直失败。。我一度以为考不了了非常绝望。居然在过了考试时间之后还是进了系统。。之后一个多小时光速答完,因为是晚上考的考试的时候满脑子想的都是快点考完睡觉hhhhh
第一次报名的时候看错时间,把12:30 am当成12:30pm, 本来以为中午考结果是凌晨,就这样错过了第一次考试。。(我的180大洋!!)话说大半夜的也会有人监考吗(?)
复习的资料就是prep guide + 63+20 + 机经 +模考,书后面的lab题也做了一下。adv的机经没有base的详细清楚,但是也可以跟着自己用书上附带data联系一下。没有想象中难~书很难啃,但其实过一遍理解关键要点就好啦,看题和机经的时候就会发现好多都是不考的。
废话不多说下面就是我从记性不好的小脑瓜中(以及结合了地里其他有用的机经...)搜刮出来的考题了,hope this may help and wish you guys good luck; ). 1point 3 acres
复习资料附在attachment里啦 我看的prep guide是400多页的版本 排版也不乱 实乃居家复习之好帮手!
选择63+20:
Q3
Q4
Q9
Q10
Q12. 1point3acres
Q16 变题 选的except corr
Q22
Q28
Q36 这是个变题。。我选了 The HASH object must be smaller than 32 bytes. 不确定对不对。但是可以排除两个错误选项A. The key component must be numeric. and C. The HASH object is created in one step and referenced in another..--
Q38
Q44
Q49
Q55 full join.
Q58
Q60. check 1point3acres for more.
新题12 填空: PUT _GLOBAL_
options CMPLIB = Sauser.sashelp
. check 1point3acres for more.
Lab:
1.SQL 选择一个表中的信息,where name在另一个表中 写这个的时候注意column的名称
proc sql;
select name from cert.tabel1
where name in ( select name from cert.tabel2 );
quit;
proc sql;
select var1, var2, var3, case when
var4<25000 then 's'
when var4 ge 25000 and var4 le 45000 then 'm'. .и
else 'l' end as var5.1point3acres
from cert.table1;. ----
quit;. check 1point3acres for more.
4. FCMP inchTOCM的function. 1point3acres.com
proc fcmp outlib=work.function.dev;
function inchtocm(height);
newheight=height*2.54;. check 1point3acres for more.
endsub;
options cmplib=work.function;
data table1;
set cert.table2;
newheight=inchtocm(height);. 1point 3 acres
run;
5.ARRAY
把dataset里所有numeric的缺失值都转化成0,先定义一个array,给array赋值_numeric_, 然后做循环将=.的值变成=0 . Waral dи,.1point3acres
data table1;
set cert.table2;.--
array vars
_numeric_; /*
用于不确定array的维度时,_numeric_指的是dataset中所有numeric的变量*/
do i = 1 to dim(vars); /* 因为前面不确定有几个数值型变量,所以这里用dim(vars)来确定循环的次数
if vars[i] =. then vars[i] = 0;
end;
run; -baidu 1point3acres
6.ARRAY-baidu 1point3acres 用array 替换变量里的A,B,C,D,E到1,2,3,4,5并输出到新的array里. check 1point3acres for more.
. 1point3acres.com
data teble1;
set cert.table2; . 1point 3acres array newcol[10] newvar1-newvar10;
array col[10] var1-var10;. 1point 3acres
do i = 1 to 10;
if col[i] = 'A' then newcol[i] = 1;
if col[i] = 'B' then newcol[i] = 2;
if col[i] = 'C' then newcol[i] = 3;. .и
if col[i] = 'D' then newcol[i] = 4;
if col[i] = 'E' then newcol[i] = 5;
end;
run;
7. ARRAY
用array把inch单位的height变量转换为cm单位的newheight。
data table1;
set cert.table2;.
array inch[3] height1-height3;
array cm[3] newheight1-newheight3;
do i =1 to 3;
cm[i] = 2.54 * inch[i];
end;.1point3acres
run;
. check 1point3acres for more. 8. MACRO
写一个loop macro,输入start和end,在循环中判断i是否大于10,大于10开始data step,输出好多个形如xi 的dataset,每个dataset里都有个x variable, x=i
比如i=20,那么x20这个dataset中就输出一个x变量, 其中x=20. check 1point3acres for more.
%macro loop(start=,end=);
%do i =&start %to &end;. 1point 3 acres
%if &i>10 %then %do;. 1point 3acres
data x&i;
x = &i;
run;
%end;. Waral dи,
%end;
%mend;
%loop(start=1,end=200);
9.HASH
创建hash table,在另一个dataset里面查找key,成功的话输出
data table;. check 1point3acres for more.
if _n_=1 then do;
call missing(name);
declare hash C(dataset:"table2");
C.definekey("var2");
C.definedata("name");
C.definedone();. 1point 3acres
end;
set table3; /*要查找的dataset*/ . ----if C.find() then output table;
run;
. Waral dи,