SASInstitute SAS advanced programming 認定 A00-202 試験問題:
1. The SAS data set ONE consists of five million observations and has 25 variables.
Which one of the following SAS programs successfully creates three new variables TOTREV, TOTCOST, and PROFIT and requires the least CPU time to be processed?
A) data two;
set one;
totrev = sum(price * quantity);
totcost = sum(fixed,variable);
profit = sum(totrev,otcost);
if totrev > 1000;
run;
B) data two;
set one;
totrev = sum(price * quantity);
where totrev > 1000;
totcost = sum(fixed,variable);
profit = sum(totrev,otcost);
run;
C) data two;
set one;
totrev = sum(price * quantity);
if totrev > 1000;
totcost = sum(fixed,variable);
profit = sum(totrev,otcost);
run;
D) data two;
set one;
where totrev > 1000;
totrev = sum(price * quantity);
totcost = sum(fixed,variable);
profit = sum(totrev,otcost);
run;
2. Given the following SAS data sets ONE and TWO:
ONE TWO NUM CHAR1 NUM CHAR2
1 A 2 X 2 B 3 Y 4 D 5 V
The following SAS program is submitted creating the output table THREE:
data three; set one two; run;
THREE
NUM CHAR1 CHAR2
1 A
2 B
4 D
2 X
3 Y
5 V
Which one of the following SQL programs creates an equivalent SAS data set THREE?
A) proc sql;C.proc sql;
create table three as
select *
from one
union
select *
from two;
quit;
B) proc sql;D.proc sql;
create table three as
select *
from one
union corr
select *
from two;
quit;
C) proc sql;
create table three as
select *
from one
outer union
select *
from two;
quit;
D) proc sql;
create table three as
select *
from one
outer union corr
select *
from two;
quit;
3. Given the following SAS data set ONE:
ONE
CATEGORY AGE SALARY BONUS
M 28 200 .
M 25 100 10
F 18 100 50
F 25 200 10
The following SAS program is submitted:
proc sql;
create table two as
select category, salary + bonus as EARNINGS from one; quit;
Which one of the following represents the data values stored in the data set TWO?
A) CATEGORY SALARY BONUS EARNINGS
M 200 . . M 100 10 110 M 200 . 200 M 100 10 110 F 100 50 150 F 200 10 210
B) CATEGORY SALARY BONUS EARNINGS
M 200 . 200 M 100 10 110 F 100 50 150 F 200 10 210
C) CATEGORY EARNINGS
M 200 M 110 F 150 F 210
D) CATEGORY EARNINGS
M . M 110 F 150 F 210
4. The following SAS program is submitted:
data temp; array points{3,2}_temporary_ (10,20,30,40,50,60); score = points{2,1}
run;
Which one of the following is the value of the variable SCORE in the data set TEMP?
A) 30
B) 20
C) 40
D) 10
5. Which one of the following programs contains a syntax error?
A) proc sql;
select p.*, c.unitcost, s.quantity
from product, cost, sales
where product.item = cost.item and
product.item = sales.item;
quit;
B) item = s.item;
quit;
C) proc sql;
select product.*, cost.unitcost, sales.quantity
from product, cost, sales
where product.item = cost.item and
product.item = sales.item;
quit;
D) proc sql;
select p.*, c.unitcost, s.quantity
from product as p, cost as c, sales as s
where p.item = c.item and
E) item = s.item;
quit;
F) proc sql;
select product.*, cost.unitcost, sales.quantity
from product p, cost c, sales s
where p.item = c.item and
質問と回答:
質問 # 1 正解: C | 質問 # 2 正解: D | 質問 # 3 正解: D | 質問 # 4 正解: A | 質問 # 5 正解: A |