注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
昨天考完, 900+ pass. 学过sas半学期,刚过的这学期逼自己用SAS来做统计作业。一学期下来觉得对SAS的环境比较熟悉了。考之前也在版上问过准备时间。就准备给自己一星期时间,每天至少5个小时。 我考的选择题主要来自50/70/123。这一星期里把70过了两遍,50 和123 各过了一遍。花了很多时间做编程题。主要是参考版上的鸡精。
我的lab题是:
1. 按customer的lastname firstname ascending, income descending 排序, 然后查几个 observation,用 proc print data=input02 (firstobs= obs=) .
2. 按postalcode, income 排序, 只keep每个postalcode中income最高的那个。 我编的是
proc sort data=input02;
by postalCode descending income;run;
data input02;
set input02;
by postalcode descending income;
if first.postalcode then highIncome=income;.--
if last.postalcode;
3. read in excel file that have several sheet.我用的
libname certXL xlsx "C:\cert\input\XX.xlsx"
proc contents data=certXL.income;
4. 求extract customerID的后5位并转化为numeric type,我用的是
IDnumber1=substr(customerID,4,5);
IDnumber=input(IDnumber1,5.);
5. merge 两个table. 要记得先sort both tables, 然后再merge. merge完了要求grand total of variable 'screw driver',我用的是 . From 1point 3acres bbs
proc means data= mergeData sum;
class product;
var screw_driver; run;
6. 改错题 bed chair desk sofa 题。原code是
if product='Bed' then output bed; 应改为 if product='BED' then output bed; 因为table里用的都是大写。
7.改错题 if firstname in ('Amanda', 'Tao', 'Destiny'),不记得具体怎么改的了。
新人求大米可以看找工面经,也祝大家都考出好成绩。最近考SAS半价。
|