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; )
复习资料附在attachment里啦 我看的prep guide是400多页的版本 排版也不乱 实乃居家复习之好帮手!
选择63+20:
Q3
Q4
Q9
Q10
Q12
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.1point3acres
Q44
Q49
Q55 full join
Q58 . check 1point3acres for more.
Q60
新题12 填空: PUT _GLOBAL_.
options CMPLIB = Sauser.sashelp
.--
. ----
Lab:. 1point3acres.com
1.SQL. ---- 选择一个表中的信息,where name在另一个表中 写这个的时候注意column的名称
proc sql;
select name from cert.tabel1
where name in ( select name from cert.tabel2 );
quit;. 1point3acres.com
. From 1point 3acres bbs 2. SQL
选择某个变量的平均值输出到macro,写就完事了
proc sql; ..
select avg(cols) into: avgcols
from cert.tabel1;
quit;
. .и
3. SQL 这个是好多机经里提到的case when,在var值小于25000时新变量=S, 25000到45000之间时新变量=M,大于45000时新变量=L 没啥难的背过就行~ 还有几个sql的题都挺小的,记不太清了,但都不难. 1point 3 acres
.google и
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
from cert.table1;
quit;
4. FCMP inchTOCM的function
proc fcmp outlib=work.function.dev;
function inchtocm(height);
newheight=height*2.54;
endsub;
options cmplib=work.function;
data table1;
set cert.table2;
newheight=inchtocm(height);
run;. 1point 3 acres
fcmp 方程,inch转化成cm,别忘了加options就可以 nothing new
. 1point 3acres 5.ARRAY
把dataset里所有numeric的缺失值都转化成0,先定义一个array,给array赋值_numeric_, 然后做循环将=.的值变成=0
.1point3acres
data table1;
set cert.table2; . check 1point3acres for more.array vars
_numeric_; /*
用于不确定array的维度时,_numeric_指的是dataset中所有numeric的变量*/
do i = 1 to dim(vars); /* 因为前面不确定有几个数值型变量,所以这里用dim(vars)来确定循环的次数
if vars[i] =. then vars[i] = 0;
end;.google и
run;
data teble1;
set cert.table2;
array newcol[10] newvar1-newvar10; .google иarray col[10] var1-var10;
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;-baidu 1point3acres
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;
. From 1point 3acres bbs 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
%macro loop(start=,end=);
%do i =&start %to &end;
%if &i>10 %then %do;
data x&i;
x = &i;
run;
%end;
%end;
%mend;
%loop(start=1,end=200);
9.HASH. 1point3acres.com
创建hash table,在另一个dataset里面查找key,成功的话输出.--
. From 1point 3acres bbs
data table;
if _n_=1 then do;.1point3acres
call missing(name);. 1point3acres.com
declare hash C(dataset:"table2");
C.definekey("var2");
C.definedata("name");
C.definedone();
end;
set table3; /*要查找的dataset*/
if C.find() then output table;. 1point3acres.com
run;