Professional Documents
Culture Documents
B.
C.
D.
QUESTION 2
Given the SAS data set SASDATA.TWO:
SASDATA.TWO
XY
---52
31
56
The following SAS program is submitted:
data sasuser.one two sasdata.three;
set sasdata two;
if x = 5 then output sasuser.one;
else output sasdata two;
run;
What is the result?
Options:
A. data set SASUSER.ONE has 5 observations
data set SASUSER.TWO has 5 observations
data set WORK.OTHER has 3 observations
B. data set SASUSER.ONE has 2 observations
QUESTION 3
The following program is submitted.
data WORK.TEST;
input Name $ Age;
datalines;
John +35
;
run;
Which values are stored in the output data set?
Options:
A.
Name
Age
--------------------John
35
B.
Name
Age
--------------------John
(missing value)
C.
Name
Age
--------------------(missing value)
(missing value)
QUESTION 4
Given the SAS data set WORK.ONE:
Id Char1
--- ----182 M
190 N
250 O
720 P
and the SAS data set WORK.TWO:
Id Char2
--- ----182 Q
623 R
720 S
The following program is submitted:
data WORK.BOTH;
merge WORK.ONE WORK.TWO;
by Id;
run;
What is the first observation in the SAS data set WORK.BOTH?
Options:
1.Id Char1 Char2
--- ----- ----182 M
QUESTION 5
Which program displays a listing of all data sets in the SASUSER library?
Options:
A.
B.
C.
D.
QUESTION 6
The following SAS program is submitted:
proc format;
value score 1 - 50 = 'Fail'
51 - 100 = 'Pass';
run;
Which one of the following PRINT procedure steps correctly applies the format?
Options:
A.
run;
B.
C.
run;
D.
var test;
run;
QUESTION 7
Given the text file COLORS.TXT:
----+----1----+----2----+---RED
BLUE
CYAN
WHITE
GRAY
BROWN
FUCSIA BLACK
PINK
MAGENTA
run;
What will the data set WORK.COLORS contain?
Options:
A.
Var1
------
Var2
------
Var3
Var4
------ ------
RED
ORANGE
RED
ORANGE
BLUE
INDIGO
BLUE
INDIGO
CYAN
WHITE
CYAN
WHITE
GRAY
BROWN
B.
Var1
------
GRAY
Var2
------
BROWN
Var3
Var4
------ ------
RED
ORANGE
BLUE
INDIGO
CYAN
WHITE
GRAY
BROWN
C.
Var1
------
Var2
------
Var3
Var4
------ ------
RED
ORANGE
YELLOW GREEN
BLUE
INDIGO
PURPLE VIOLET
D.
Var1
------
Var2
------
Var3
Var4
------ ------
RED
ORANGE
YELLOW GREEN
BLUE
INDIGO
PURPLE VIOLET
CYAN
WHITE
FUCSIA BLACK
GRAY
BROWN
PINK
MAGENTA
QUESTION 8
The following SAS program is submitted:
data work.accounting;
set work.dept1 work.dept2;
jobcode = FA1;
length jobcode $ 8;
run;
A character variable named JOBCODE is contained in both the WORK.DEPT1 and WORK.DEPT2 SAS data sets. The
variable JOBCODE has a length of 5 in the WORK.DEPT1 data set and a length of 7 in the WORK.DEPT2 data set. What
is the length of the variable JOBCODE in the output data set?
Options:
A.
B.
C.
D.
QUESTION 9
Given the SAS data set WORK.INPUT:
Var1
Var2
------
-------
one
two
three
four
five
B.
C.
D.
QUESTION 10
Given the following SAS error log
data WORK.OUTPUT;
set SASHELP.CLASS;
BMI=(Weight*703)/Height**2;
where bmi ge 20;
ERROR: Variable bmi is not on file SASHELP.CLASS.
run;
What change to the program will correct the error?
Options:
QUESTION 11
The following SAS program is submitted:
footnote1 Sales Report for Last Month;
footnote2 Selected Products Only;
footnote3 All Regions;
footnote4 All Figures in Thousands of Dollars;
proc print data = sasuser.shoes;
footnote2 All Products;
run;
Which footnote(s) is/are displayed in the report?
Options:
A.
All Products
B.
C.
D.
Sales Report for Last Month All Products All Regions All Figures in Thousands of Dollars
QUESTION 12
The following SAS program is submitted:
data WORK.LOOP;
X = 0;
do Index = 1 to 5 by 2;
X = Index;
end;
run;
Upon completion of execution, what are the values of the variables X and Index in the SAS data set named
WORK.LOOP?
Options:
1.X
2.X
3.X
4.X
=
=
=
=
3,
5,
5,
5,
Index
Index
Index
Index
=
=
=
=
5
5
6
7
QUESTION 13
This item will ask you to provide a line of missing code;
The SAS data set WORK.INPUT contains 10 observations, and includes the numeric variable Cost.
The following SAS program is submitted to accumulate the total value of Cost for the 10 observations:
data WORK.TOTAL;
set WORK.INPUT;
<insert code here>
Total=Total+Cost;
run;
Which statement correctly completes the program?
Options:
1.keep Total;
2.retain Total 0;
3.Total = 0;
4.If _N_= 1 then Total = 0;
QUESTION 14
Given the raw data record DEPT:
----|----10---|----20---|----30
Printing 750
The following SAS program is submitted:
data bonus;
infile dept;
inputdept$ 1-11 number 13- 15;
<insert statement here>
run;
Which SAS statement completes the program and results in a value of Printing750 for the DEPARTMENT variable?
Options:
A.
B.
C.
D.
department=trim(dept)||put(number,3.);
QUESTION 15
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
50
400
350
800
W7693
25
100
125
250
W1387
300
250
550
Options:
A.
B.
C.
D.
QUESTION 16
The SAS data set SASUSER.HOUSES contains a variable PRICE which has been assigned a permanent label of Asking
Price. Which SAS program temporarily replaces the label Asking Price with the label Sale Price in the output?
Options:
A.
B.
proc print data = sasuser.houses label; label price Sale Price; run;
C.
proc print data = sasuser.houses label; label price = Sale Price; run;
D.
QUESTION 17
The following SAS program is submitted:
data one;
addressl = 214 London Way;
run;
data one;
set one;
address = tranwrd(address1, Way, Drive);
run;
A.
B.
C.
D.
QUESTION 18
The following SAS program is submitted:
data WORK.TEMP;
Char1='0123456789';
Char2=substr(Char1,3,4);
run;
What is the value of Char2?
Options:
A.
23
B.
34
C.
345
D.
2345
QUESTION 19
The SAS data sets WORK.EMPLOYEE and WORK.SALARY are shown below:
WORK.EMPLOYEE WORK.SALARY
fname age name salary
Bruce 30 Bruce 25000
Dan 40 Bruce 35000
Dan 25000
The following SAS program is submitted:
data work.empdata;
by fname;
totsal + salary;
run;
Which one of the following statements completes the merge of the two data sets by the FNAME variable?
Options:
A.
merge work.employee
merge work.employee
merge work.employee
merge work.employee
QUESTION 20
The following SAS program is submitted:
data work.sets;
do until (prod gt 6);
prod + 1;
end;
run;
What is the value of the variable PROD in the output data set?
Options:
A.
B.
C.
D.
(missing numeric)