sas base 2022.10.14 958 pass
10525
背景:上官方课程+ prep guide + 70+机精
lab 部分:8道题
1. merge (要先sort)output 三个dataset, 一个是包含在 a 同时在b 的, 一个是在a, 不在b 的, 一个是在b 不在a 的。
proc sort data=cert.input68a out=outputxxa;
by memberid;
run;
proc sort data=cert.input68b out=outputxxb;
by memberid;
run;
data results.outputxx;
merge outputxxa(in=a) outputxxb(in=b);
if a=1 and b=1 then output A;
if a=1 and b=0 then output B;
if a=0 and b=1 then output C;
2. fullname 分离其中的firstname 和last name, 中间是空格连接
忽略大小写,问Xin OO 有几个
--> scan(fullname,1," ")
-->upcase
3. transpose 给出输出的data set ,var /id /by
proc transpose data=ooo out=xxx;
var O inventory
id product;
by xx;
以上是真题回答
4.问 encoding and label
proc contents data=OOO;
run; (result中有图可看结果)
5.汇入excel档案 问sheet A中变数,sheet C...
6.给data set 问第n个观察值变数B是多少
7.分成两组年龄(具体忘了)
if age<=39 then ...
else if 40<=age<65 then ...
else;
8.proc means proc freq 回答问题
改错:
前辈的(1)young那题 (2)proc freq --> tables ...
选择 19题
(1)MDY(01,15,1960)=14
(2) macro-variable
(3)transpose 用到哪个statement--> var/id/class/label...
(4)fmt -->catalog? (70有)
(5)merge( a=1 and b=0) or (a=0 and b=1) -> 几个变数
(6)ods powerpoint file="";
ods close;
(7) do loop
(8)proc print label;
label aaa="sss";
(9)proc sort 中descending呈现结果
预设递增1-->10 ,a-->z ;递减相反
给一个 by abc descending bcd;
abc(文字型变数) 递增 bcd(数值型变数)递减 问第一个obs是?
ex:fooooo 7oooo
(10)do loop output位置-->输出后有多少个obs
(11) %let
剩下不记得了
- 16
- 分享至
5条回复
发表回复
一亩三分地BBS
发现更多讨论
关注微信公众号
更多精彩内容
相关主题