导航菜单
首页 >  sas基础考试日期  > SAS Base备考

SAS Base备考

备考准备 考试基本信息(其他博主)

考试题目:62个。正确率超过70%算通过。

考试时间:1小时40分钟(半小时就可以做完)。

题目来源:70题(~75%)+机经(常见机经都考到了,~20%)+123题(~5%)。

复习过程(约20小时):

看70题(2小时)- 做50题(5小时)- 做70题(5小时)-做123题(8小时)

考试当天抱佛脚(约3-4小时):

闭卷一口气做完70题(错5个,做题加纠错约1-2小时)-看机经(1-2小时)

70题仍然是王道,大部分题都还是从70题里面出的,建议在Crackman网站上看70题,有解释和讨论;

填空题 ,我遇到2道填空,是从选择题变成填空的;

书籍 The Little SAS book 第一章到第六章.SAS Certification Prep Guide-Base Programming for SAS9 做题 70题,结合,123题,50题.95题 过来人的分享 https://bbs.pinggu.org/forum.php?mod=viewthread&tid=4747624&fromhttps://bbs.pinggu.org/thread-6353154-1-1.htmlhttps://www.1point3acres.com/bbs/thread-312405-1-1.htmlhttps://www.1point3acres.com/bbs/thread-218894-1-1.htmlhttps://bbs.pinggu.org/thread-4172814-1-1.html 机经

给了code,其中有一句是label test='testinglocationtemperature)。 ​ 问怎么wrap? ​ 选择 split = ‘*’;

dataset TEST 有两个变量(VAR1, VAR2) ​ data test2; ​ set test; ​ input var1 $ var2; ​ total=total+var2; ​ run; ​ 问output是什么? 因为没有给total赋值,所以total为missing value。 ​ 输出结果为 var1 var2 total ​ a 1 . ​ b 3 . ​ c 5 . ​ -> 选择最左边那行都为 missing value的!!

Cutoffyear=1970; ​ data TWO; ​ X = '01Jan1960’d; ​ YearA = year(X) ​ 问yearA是多少 -> 选2060

Solution: 因为 year(X) 读取的年份,必须晚于 Cutoffyear=1970。所以 '01Jan1960’d 读取 ‘1960’, year()函数识别出的 不可能是 1960(earlier than 1970),而是 2060(later than 1970)

原题

95题的93题

This question will ask you to provide a line of missing code. Given the following data set WORK.SALES: SalesID SalesJan FebSales MarchAmt

W6790 50 400 350 W7693 25 100 125 W1387 . 300 250 The following SAS program is submitted: data WORK.QTR1; set WORK.SALES; array month{3} SalesJan FebSales MarchAmt; run; Which statement should be inserted to produce the following output? SalesID SalesJan FebSales MarchAmt Qtr1

W6790 50 400 350 800 W7693 25 100 125 250 W1387 . 300 250 550 A.Qtr1 = sum(of month{ALL});

B.Qtr1 = month{1} + month{2} + month{3}; C.Qtr1 = sum(of month{*}); D.Qtr1 = sum(of month{3});

data b;input salesid $ SalesJan FebSales MarchAmt;cards;W6790 50 400 350W7693 25 100 125W1387 . 300 250;run;data c;set b;array month{3} SalesJan FebSales MarchAmt;Qtr1=sum(of month{*});run; proc print data=c; title'95题的第93题'; run;

在这里插入图片描述

123题的93题解释

because after reading following statement input employee_name $ 1-4; SAS advances to next line of raw data file and next input statement if employee_name = ‘Sue’ then input age 7-8; reads age for John as age of SUE which is 40.

在这里插入图片描述

在这里插入图片描述

70题的17题

17.Given the following data step:

data WORK.GEO;

​ infile datalines;

​ input City $20.;

​ if City=‘Tulsa’ then

​ State=‘OK’;

​ Region=‘Central’;

​ if City=‘Los Angeles’ then

​ State=‘CA’;

​ Region=‘Western’;

datalines;

Tulsa

Los Angeles

Bangor

;

run;

After data step execution, what will data set WORK.GEO contain?

​ A.

City State Region

Tulsa OK Western

Los Angeles CA Western

Bangor Western

​ B.

City State Region

Tulsa OK Western

Los Angeles CA Western

Bangor

变形题

70题的18题

18.Which statement describes a characteristic of the SAS automatic variable ERROR?

​ A. The ERROR variable maintains a count of the number of data errors in a DATA step.

​ B. The ERROR variable is added to the program data vector and becomes part of the data set being created.

​ C. The ERROR variable can be used in expressions in the DATA step.

​ D. The ERROR variable contains the number of the observation that caused the data error.

Answer: C

(变形) 选ONLY CAN BE IN EXPRESION IN THE DATA STEP.

70题的27题

原来的题目及要求

27.Given the SAS data set WORK.TEMPS:

Day Month Temp

​ 1 May 75

15 May 70

15 June 80

​ 3 June 76

​ 2 July 85

14 July 89

The following program is submitted:

proc sort data=WORK.TEMPS;

​ by descending Month Day;

run;

proc print data=WORK.TEMPS;

run;

Which output is correct?

​ A.

Obs Day Month Temp

1 2 July 85

2 14 July 89

3 3 June 76

4 15 June 80

5 1 May 75

6 15 May 7

​ B.

Obs Day Month Temp

1 1 May 75

2 2 July 85

3 3 June 76

4 14 July 89

5 15 May 70

6 15 June 80

​ C.

Obs Day Month Temp

1 1 May 75

2 15 May 70

3 3 June 76

4 15 June 80

5 2 July 85

6 14 July 89

​ D.

Obs Day Month Temp

1 15 May 70

2 1 May 75

3 15 June 80

4 3 June 76

5 14 July 89

6 2 July 85

Answer: C

变形之后的问题:by day descending Month

Answer:B

70题的24题

28.Given the SAS data set WORK.P2000:

Location Pop2000

Alaska 626931

Delaware 783595

Vermont 608826

Wyoming 493782

and the SAS data set WORK.P2008:

State Pop2008

Alaska 686293

Delaware 873092

Wyoming 532668

The following output is desired:

Obs State Pop2000 Pop2008 Difference

1 Alaska 626931 686293 59362

2 Delaware 783595 873092 89497

3 Wyoming 493782 532668 38886

Which SAS program correctly combines the data?

​ A.

data compare;

merge WORK.P2000(in=_a Location=State)

​ WORK.P2008(in=_b);

by State;

if _a and _b;

Difference=Pop2008-Pop2000;

run;

​ B.

data compare;

merge WORK.P2000(rename=(Location=State))

​ WORK.P2008;

by State;

if _a and _b;

Difference=Pop2008-Pop2000;

run;

​ C.

data compare;

merge WORK.P2000(in=_a rename=(Location=State))

​ WORK.P2008(in=_b);

by State;

if _a and _b;

Difference=Pop2008-Pop2000;

run;

​ D.

data compare;

merge WORK.P2000(in=_a) (rename=(Location=State))

​ WORK.P2008(in=_b);

by State;

if _a and _b;

Difference=Pop2008-Pop2000;

run;

Answer: C

70题的35题

35.given the SAS data set SASDATA.TWO:

X Y

5 2

3 1

5 6

The following SAS program is submitted:

data SASUSER.ONE SASUSER.TWO OTHER;

​ set SASDATA.TWO;

​ if X eq 5 then output SASUSER.ONE;

​ if Y lt 5 then output SASUSER.TWO;

​ output;

run;

答案:

data set SASUSER.ONE has 5 observations

data set SASUSER.TWO has 5 observations

data set WORK.OTHER has 3 observations

解释:

开始IF判断,判断为真就是OUTPUT到SASUSER.ONE数据集中。但是这里没有交代如果为假将会怎么样。我个人认为即使是假,也不会做任何处理。因为没有在假这个条件下的执行语句。

变形:

变else output other -> 选2 2 1

70题的42题

.The following SAS program is submitted:

data WORK.ONE;

​ Text=‘Australia, US, Denmark’;

​ Pos=find(Text,‘US’,‘i’,5);

run;

What value will SAS assign to Pos?

​ A. 0

​ B. 1

​ C. 2

​ D. 12

从Australia, US, Denmark 字符串的第五个字符开始,字母i表示忽略字符串中大小写,寻找字符串US在源字符串中的起始位置,并返回起始位置的数字给POS。

变形题:(变填空) 变Text=‘US-Australia-Denmark’ -> 填5

几个问题值得思考,第一个是如果没有’i’这个参数,结果会怎么样?如果把5改成1,

data WORK.ONE; Text='Australia, US, Denmark'; Pos=find(Text,'US','i',1); run; proc print data=one; title'find(Text,'US','i',1)输出结果'; run;

在这里插入图片描述

在这里插入图片描述

70题的63题

62.The following SAS program is submitted:

​ proc means data=SASUSER.SHOES;

​ where Product in (‘Sandal’ , ‘Slipper’ , ‘Boot’);

​ run;

Which ODS statements, inserted in the two locations above, create a report stored in an html file?

​ C.

ods html file=‘sales.html’;

ods html close;

变report in pdf了 -> 找ods pdf file = ’ xx.pdf’; ods pdf file;

70题的43题

43.Given the SAS data set WORK.ORDERS:

WORK.ORDERS

order_id customer shipped

9341 Josh Martin 02FEB2009

9874 Rachel Lords 14MAR2009

10233 Takashi Sato 07JUL2009

The variable order_id is numeric; customer is character; and shipped is numeric, contains a SAS date value, and is shown with the DATE9. format.

A programmer would like to create a new variable, ship_note, that shows a character value with the order_id,shipped date, and customer name.

For example, given the first observation ship_note would have the value “Order 9341 shipped on 02FEB2009 to Josh Martin”.

Which of the following statement will correctly create the value and assign it to ship_note?

​ A. ship_note=catx(’ ',‘Order’,order_id,‘shipped on’,input(shipped,date9.),‘to’,customer);

​ B. ship_note=catx(’ ',‘Order’,order_id,‘shipped on’,char(shipped,date9.),‘to’,customer);

​ C. ship_note=catx(’ ',‘Order’,order_id,‘shipped on’,transwrd(shipped,date9.),‘to’,customer);

​ D. ship_note=catx(’ ',‘Order’,order_id,‘shipped on’,put(shipped,date9.),‘to’,customer);

Answer: D

变形题有两个博主给出不同的答案

变形put(shipped_date, worddate9.)

(选项变形) 选put( )短的那个 -> put(shipped_date, worddate20.)

70题的45题

关于ods csvall file有一道选择格式,ods csv file是不对的

70题的57题

57.Given the SAS data set WORK.ONE:

N BeginDate

- ---------

1 09JAN2010

2 12JAN2010

The following SAS program is submitted:

data WORK.TWO;

​ set WORK.ONE;

​ Day=;

​ format BeginDate date9.;

run;

The data set WORK.TWO is created, where Day would be 1 for Sunday, 2 for Monday, 3 for Tuesday, … :

WORK.TWO

N BeginDate Day

- --------- —

1 09JAN2010 1

2 12JAN2010 4

Which expression successfully completed the program and creates the variable Day?

​ A. day(BeginDate)

​ B. weekday(BeginDate)

​ C. dayofweek(BeginDate)

​ D. getday(BeginDate,today())

Answer: B

变形:

day不再是一周里的第几天了,day数据变成一个12一个9,选day(begindate)

70题的66题

66.The following SAS program is submitted:

data WORK.SALES;

​ do Year=1 to 5;

​ do Month=1 to 12;

​ X + 1;

​ end;

​ end;

run;

How many observations are written to the WORK.SALES data set?

​ B. 1

66题变形

(变形) 在两个end中间加了output -> 5

data WORK.SALES;do Year=1 to 5; do Month=1 to 12;X + 1;end; end; run; proc print data=sales; title'66题:两个end中间没有output输出结果'; run; data WORK.SALES;do Year=1 to 5; do Month=1 to 12;X + 1;end;output; end; run; proc print data=sales; title'变形:两个end中间有output输出结果'; run;

在这里插入图片描述

在这里插入图片描述

新题

题目:人口增长速率是2%,给了一个2012年到2021年每年人口的表格。

问:如何得到这样的表格

正确答案包含下面的code:

do year= 2012 to 2021;

pop=pop*1.02;

output;

end;

run:

给了code,其中有一句是label test='testinglocationtemperature)。 ​ 问怎么wrap? ​ 选择 split = ‘*’;

找语法错误

有个题目让找错,错误是datalines后面没有分号semicolon。

自我总结

上面的信息,是我从经管之家以及各大论坛收藏的,刚好在2018.12.29去南宁学院考试,下面分享以下我个人的一些见解

看机经还是比较好用的,了解一下题型和通过是要达到的分数,我考了89%,70%以上就可以通过,也算很幸运了,因为最近在学校比较忙,所以没多复习,不过,我有一些基础,毕竟大学大二的时候有学习SAS,还有在论坛上买一些资料,新题还是有的,不过大家都是这么说,通过的话不难,多看一下70题和123题,会过的。

也是去了才知道SAS全球认证考试已经加入VUE考试中心,还以为我走错地方了,经过问那里的学生,终于确定了自己的考试地点确实在南宁学院。

考试提交结果就可以马上知道成绩的,所以很happy。

顺便给大家看一下我的成绩单 在这里插入图片描述

也和大家分享一些我的资料吧,这些都是用论坛币去买的,不过,我还是觉得很多人没有论坛币想得到资料很麻烦,所以这里是免费给大家

70题:

相关推荐: