We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 60
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Question: 1
Which of the following statement(s) in the DATASETS procedure alters the name of a
SAS data set stored in a SAS data library?
A. RENAME statement only
B. CHANGE statement only
C. MODIFY and RENAME statements
D. MODIFY and CHANGE statements
Answer: B
Question: 2
‘The following SAS program is submitted: ; %let development =
ontime; proc print data = sasuser:highway; title "For &dept”; title2 "This project was
completed &development"; run; Which one of the following statements completes the
above and resolves titlel to "For researché-development"?
A. Selet dept = %estr(researché&development);
str(research% &development);
nrstr(researchéedevelopment);
D. %let dept = Ynrstr(research%&development);
Answer: C
Question: 3
Which one of the following options controls the pagesize of a SAS data set?
D. PAGESIZE:
Answer: C
Question: 4
Given the following SAS data set ONE: ONE REP COST. SMITH 200
SMITH 400
JONES 100
SMITH 600
JONES 100
JONES 200
JONES 400
SMITH 800
JONES 100
JONES 300
‘The following SAS program is submitted: proc sql:(A00-202) SAS Advanced Programming Exam Study Guide
A00-202
select rep, avg(cost) as AVERAGE from one group by rep having avg(cost) > (select
avg(cost) from one);
quit;
Which one of the following reports is generated?
A. REP AVERAGE JONES 200
B. REP AVERAGE JONES 320
C. REP AVERAGE _ SMITH 320
D. REP AVERAGE ‘SMITH 500
Answer: D
Question: 5
‘The following SAS program is submitted:
proc sort data = sales tagsort;
by month year; run;
Which of the following resource(s) is the TAGSORT option reducing?
A. UO usage only
B. CPU usage only
C. VO and CPU usage
D. temporary disk usage
Answer: D
Question: 6
‘The following SAS program is submitted:
data one;
doi=1to 10;
ptobs = ceil(ranuni(0) * totobs);
set temp point = ptobs nobs = totobs;
output;
end;
stop:
run;
The SAS data set TEMP contains 2,500,000 observations. Which one of the following
represents the possible values for PTOBS?
A. any integer between 1 and 10
B. any real number between 0 and 1
CC. any integer between I and 2,500,000
D. any real number between 1 and 2,500,000
Answer: C
Question: 7
3 bntpsimuwePIanetLabs com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Which one of the following programs contains a syntax error?
A. proc sql;
select product.*, cost.unitcost, sales.quantity
from product p, cost c, sales s
where p.ite
quit:
B. proc sql;
select product.*, cost.unitcost, sales.quantity
from product, cost,
sales where product item
quit;
C. proc sql:
select p.*, C.unitcost, s.quantity
from product as p, cost as c, sales as s
where p.item = c.item and p.item = s.item;
cost.item and product.item = sales.item;
select p.*, c.unitcost, s.quantity
from product, cost, sales
where product. item = cos
quit;
sm and product.item = sales.item;
Answer: D
Question: 8
‘The following SAS code is submitted:
macro houses(dsn = houses,sub = RANCH);
data &dsn;
set sasuser houses; if style
run;
omend;
ohouses(sub = SPLIT)
Gehouses(dsn = ranch)
%Fhouses(sub = TWOSTORY)
Which one of the following is the value of the automatic macro variable SYSLAST?
‘&sul
A. work.ranch
B. work houses
C. WORK.RANCH
D. WORK. HOUSES
‘Answer: D
Question: 9
Given the following SAS data sets ONE and TWO:
4 bios. ePlaneabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
ONE TWO
NUM COUNTRY NUM CITY
| CANADA 3 BERLIN
2 FRANCE 5 TOKYO
3 GERMANY
4 BELGIUM
5 JAPAN
‘The following SAS program is submitted:
proc sql:
select country from one
where not exists (select * from two where one.num = two.num);
quit;
Which one of the following reports is generated?
A. COUNTRY GERMANY JAPAN
B, COUNTRY - FRANCE BELGIUM
C. COUNTRY - CANADA FRANCE BELGIUM
D. COUNTRY - CANADA FRANCE GERMANY
Answer: C
Question: 10
Which one of the following statements is true?
A. The WHERE statement can be executed conditionally as part of an IF statement,
B. The WHERE statement selects observations before they are brought into the PDV.
CC. The subsetting IF statement works on observations before they are read into the
PDV.
D, The WHERE and subsetting IF statements can be used interchangeably in all SAS
programs.
Answer: B
Question: 11
‘The variable attributes of SAS data sets ONE and TWO are shown below:
ONETWO
# Variable Type Len Pos # Variable Type Len Pos
2 sales Num 8 8 2 budget Num 8 8
1 year Num 8 0 3 sales Char 8 16
1 year Num 8 0
Data set ONE contains 100 observations. Data set TWO contains 50 observations.
Both data sets are sorted by the variable YEAR. The following SAS program is,
submitted: data three;
merge one two;
by year;
5 hitoww.ePlanetLabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
run;
Which one of the following is the result of the program execution?
A. No messages are written to the SAS log.
B. ERROR and WARNING messages are written to the SAS log.
C. Data set THREE is created with two variables and 50 observations.
D. Data set THREE is created with three variables and 100 observations.
Answer: B
Question: 12
Given the following SAS statement
let idcode = Prod567;
Which one of the following statements stores the value 567 in the macro variable
CODENUM?
A. elet codenum = substr(&idcode,length(&idcode)-2);
B, %let codenum = substr( &idcode,length(&ideode)-3);
C. let codenum = %esubstr(&idcode, %length(&idcode)-2);
D. Sblet codenum = osubstr(&idcode, Ylength( &idcode)-3);
Answer: C
Question: 13
The following SAS program is submitted:
data new (bufsize = 6144 bufno = 4);
set old;
run;
Which one of the following describes the difference between the usage of BUFSIZE=
and BUFNO= options?
‘A. BUFSIZE= specifies the size of the input buffer in bytes; BUFNO= specifies the
number of input buffers.
B. BUFSIZE= specifies the size of the output butffer in bytes; BUFNO= specifies the
number of output buffers.
C. BUFSIZE= specifies the size of the output buffer in kilobytes; BUFNO= specifies the
number of input buffers.
D, BUFSIZE= specifies the size of the output buffer in kilobytes; BUFNO=
number of output buffers.
specifies the
Answer: B
Question: 14
Consider the following SAS log:
229 data sasuser.ranch sasuser.condo / view = sasuser.ranch;
6 tito ePtanet abs co(A00-202) SAS Advanced Programming Exam Study Guide
0.202
230 set sasuser-houses;
231 if style = 'RANCH' then output sasuser.tanch;
232 else if style = ‘CONDO’ then output sasuser.condo;
233 run; NOTE:
DATA STEP view saved on file SASUSER.RANCH. NOTE:
‘A stored DATA STEP view cannot run under a different operating system. 234 235 proc
print data = sasuser.condo;
ERROR:
File SASUSER.CONDO.DATA does not exist. 236 run:
NOTE: The SAS System stopped processing this step because of errors.
Which one of the following explains why the PRINT procedure fails?
‘A. SASUSER.CONDO is a stored DATA step program.
B. A SAS data file and SAS data view cannot be created in the same DATA step.
C.A second VIEW=SASUSER.CONDO option was omitted on the DATA statement.
D. The view SASUSER.RANCH must be processed before SASUSER.CONDO is
created.
Answer: D
Question: 15
Which one of the following is an advantage of creating and using a SAS DATA step
view?
A. It can store an index.
B. It always accesses the most current data.
C. It works quickly through multiple passes of the data.
D. It is useful when the underlying data file structure changes.
Answer: B
Question: 16 Given the following SAS data sets ONE and TWO:
ONE TWO YEAR QTR BUDGET YEAR QTR SALES
2001 3 500 2001 4 300
2001 4 400 2002 1 600
2002 1 700
‘The following SAS program is submitted:
proc sql;
select one.*, sales from one, two;
quit;
‘Which one of the following reports is generated?
A. YEAR QTR BUDGET SALES
2001 4 400 300
7 hito:w.ePtanetL abs co(A00-202) SAS Advanced Programming Exam Study Guide
00-202
2002 1 700 600
B. YEAR QTR BUDGET SALES
2001 3 500
2001 4 400 300
2002 1 700 600
C. YEAR QTR BUDGET SALES
2001 3 500 300
2001 4 400 300
2002 1 700 600 D.
YEAR QTR BUDGET SALES
2001 3 500 300
2001 4 400 300
2002 1 700 300,
2001 3 500 600,
2001 4 400 600,
2002 1 700 600
Answer: D
Question: 17 Given the following SAS data set ONE:
ONE NUM VAR
1A
2B
3c
Which one of the following SQL programs deletes the SAS data set ONE?
A. proc sql;
delete table one;
quit;
B. proc sql:
alter table one
drop num, var;
quit;
C. proc sql;
Grop table one:
quit;
D. proc sql;
delete from one;
quit:
Answer: C
8 tito ePlanettabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Question: 18
Given the following SAS data sets ONE and TWO
ONE TWO YEAR QTR BUDGET YEAR QTR SALES
2001 3 500
2001 4 300
2001 4 400
2002 1 600 |
2002 1 700
‘The following SAS program is submitted:
proc sql;
select one.*, sales from one, two where one.year = two.years
quit;
‘Which one of the following reports is generated?
‘A. YEAR QTR BUDGET SALES
2001 4 400 300
2002 1 700 600
B. YEAR QTR BUDGET SALES
2001 3500.
2001 4.400 300
2002 1 700 600,
C. YEAR QTR BUDGET SALES
2001 3 500 300,
2001 4 400 300,
2002 1 700 600
D. YEAR QTR BUDGET SALES
2001 3 500 300
2001 4 400 300
2002 1 700 300
2001 3 500 600
2001 4 400 600
2002 1 700 600
Answer: C
Question: 19
The SAS data set 1
A Frequency
150,000
2,500,000
6 7,000,000
EMP has the following distribution of values for variable
8 ntps/www.ePianetlabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
8 3,000
Which one of the following SAS programs requires the least CPU time to be
processed?
‘A, data new: set temp;
ifa=8 then b= ‘Small
else if a in(1, 2) then
b= "Medium’;
else ifa=6 then
b="Large’ run;
B. data new;
set temp;
iffa in (1, 2) then
b= Medium’;
else ifa= 8 then
b='Small’
C. data new;
set temp;
then b= ‘Large’;
else if a in (1, 2) then
set temp;
if a=6 then
b="Large
ifa in (1, 2) then
‘Small’;
run;
Answer: C
Question: 20
The following SAS program is submitted:
Solet value = 9;
Sblet value’
let newval
Goeval(&value / &value2);
Which one of the following is the resulting value of the macro variable NEWVAL?
10 bit/wm,ePianetLabs.com(A00-202) SAS Advanced Programming Exam Study Guide
‘00-202
D. null
‘Answer: A
Question: 21
The following SAS program is submitted:
Gelet lib = Youpease(sasuser);
proc sql;
select nvar from
ictionary.tables
where libname
quit;
Given that several SAS data sets exist in the SASUSER library, which one of the
following is generated as output?
A. no result set
B. a syntax error in the log
C. areport showing the names of each table in SASUSER
D. a report showing the number of columns in each table in SASUSER
Answer: D
Question: 22
Given the following SAS data set ONE:
ONE GROUP SUM,
A165
B123
C564
The following SAS program is submitted:
data _null_;
set one; call symput(group,sum);
Which one of the following is the result when the program finishes execution?
A. Macro variable C has a value of 564,
B, Macro variable C has a value of 1452.
C. Macro variable GROUP has a value of 564.
D. Macro variable GROUP has a value of 1452.
Answer: A
Question: 23
‘The SAS data set ONE
consists of five million observations and has 25 variables.
" how ePlanetLabs.com(A00-202) SAS Advanced Programming Exam Study Gi
-A00-202
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 = sumiprice * quantity);
totcost = sum(fixed, variable);
profit = sum(totrev,otcost); if totrev > 1000; run;
B. data two;
set one;
totrev = sum(price * quantity);
if totrev > 1000;
toteost = sum( fixed, variable);
profit = sum(totrev,otcost); run;
C. data two;
set one; totre
sum(price * quantity);
where 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;
Answer: B
Question: 24
Given the following SAS data set ONE:
ONE COUNTRY CITY VISIT
USA BOSTON 10
UK LONDON 5
USA DALLAS 10
UK MARLOW 10 USA BOSTON 20
UK LONDON 15
USA DALLAS 10
The following SAS program is submitted:
roc sql:
select country, city, sum(visit) as TOTAL
from one group by country, city order by country, total dese;
quit;
‘Which one of the following reports is generated?
A. COUNTRY CITY TOTAL
2 ito ePlanetLabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
UK MARLOW 10
UK LONDON 20
USA BOSTON 50
USA DALLAS 20
B. COUNTRY CITY TOTAL
UK LONDON 20
UK MARLOW 10
USA BOSTON 50
USA DALLAS 20
C. COUNTRY CITY TOTAL,
USA BOSTON 50
D. COUNTRY CITY TOTAL
UK MARLOW 10
UK LONDON 20
USA DALLAS 20
USA BOSTON 50
Answer: B
Question: 25
Given the following SAS data sets ONE and TWO:
ONE TWO NUM CHAR! NUM CHAR2
1A2x
2B3Y
4D5V
‘The following SAS program is submitted creating the output table THREE:
data three;
set one two;
{UM CHARI CHAR?
Which one of the following SQL programs creates an equivalent SAS data set THREE?
A. proc sql; create table three as
select *
from one outer union cor
select *
from two;
8 tpn. ePtanet abs com
13(A00-202) SAS Advanced Programming Exam Study Gi
00202
quit;
B. proc sql;
create table three as
select *
from one outer union
select *
from two:
quit;
C. proc sql;
create table three as
select *
from one outer union
select *
quit;
D. proc sql:
create table three as
select *
from one union corr
select *
from two;
quit;
Answer: A
Question: 26
Which one of the following automatic SAS macro variables contains the return code
from a previously executed step?
A. &RC
B. &ERR
C. &SYSRC
D. &SYSERR
Answer: D
Question: 27
‘The SAS data set ONE has a variable X on which an index has been created. The data
sets ONE and THREE are sorted by X. Which one of the following SAS programs uses
the index to select observations from the data set ONE?
A. data two;
set three;
set one key =
run;
B. data two;
set three key
4 hitouwiw.ePtanetLads.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
set one;
run;
C. data two;
set one;
set three key = X;
run;
D. data tw
set three;
set one (key = X);
run;
Answer: A
Question: 28
Given the following SAS data set ONE:
ONE REP AREA COST
SMITH NORTH 100
SMITH SOUTH 200
JONES EAST 100
SMITH NORTH 300
JONES WEST 100
JONES NORTH 200
JONES NORTH 400
SMITH NORTH 400
JONES WEST 100
JONES WEST 300
‘The following SAS program is submitted:
proc sql;
select rep, area, count(*) as TOTAL from one group by rep, area; quit;
Which one of the following reports is generated?
A. REP AREA COUNT
JONES EAST 100
JONES NORTH 600
JONES WEST 500
SMITH NORTH 800
SMITH SOUTH 200
B, REP AREA TOTAL
JONES EAST 100
JONES NORTH 600
JONES WEST 500
SMITH NORTH 800
% htpsnew.ePlanetLabs.com
15(A00-202) SAS Advanced Programming Exam Study Guide
‘00-202
‘SMITH SOUTH 200
C. REP AREA TOTAL
JONES EAST |
JONES NORTH 2
JONES WEST 3
SMITH NORTH 3
JONES WEST 3
‘SMITH NORTH 3
SMITH SOUTH |
D. REP AREA TOTAL
JONES EAST |
JONES NORTH 2
JONES WEST 3
SMITH NORTH 3
SMITH SOUTH |
SMITH NORTH 3
SMITH SOUTH 1
Answer:
.D
Question: 29
Which one of the following SAS procedures changes a permanent format of a
variable stored in a SAS data set?
‘A. MODIFY
B. FORMAT
C. CONTENTS
D. DATASETS
Answer: D
Question: 30
Given the following SAS data set SASUSER.HIGHWAY:
SASUSER HIGHWAY STEERING SEATBELT SPEED STATUS COUNT
absent no 0-29 serious 31
absent no 0-29 not 1419
absent no 30-49 serious 191
absent no 30-49 not 2004
absent no 50+ serious 216
The following SAS program is submitted:
emacro highway;
proc sql noprint;
select count(distinct status) into
8 htpwwePtanetLbs oom(A00-202) SAS Advanced Programming Exam Study Guide
‘Ao0-202
‘numgrp from sasuser.highway;
blet numgrp = &numgrp;
select distinct status into
group|-:group&numgrp from sasuser.highway;
quit;
Godlo i = 1 %t0 &numgrp;
proc print data = sasuser highway;
where status =
run;
Goend;
omend;
Sohighway
How many reports are produced by the above program?
A.0
BAI
C.2
D.S
Answer: C
Question: 31
Text is sent to the SAS compiler as a result of macro execution. Which one of the
following SAS System options writes that text to the log?
A. MPRINT
B. MLOGIC
C. MSOURCE
D. SOURCE2
Answer: A.
Question: 32
Given the following SAS data set ONE:
ONE CATEGORY AGE SALARY BONUS
M 28 200
M25 100 10
F 18 10050
F-25200 10
‘The following SAS program is submitted:
proc sql;
‘create table two as
select category, salary + bonus as EARNINGS
from one;
quit;
” tition ePlanot abs com
718
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Which one of the following represents the data values stored in the data set TWO?
A. CATEGORY EARNINGS.
M 200
M110
F150F210
B. CATEGORY EARNINGS
M.
M0
F150
F210
C. CATEGORY SALARY BONUS EARNINGS
M 200 . 200
M 100 10 110
F 10050 150
F 200 10 210
D. CATEGORY SALARY BONUS EARNINGS
M200
M 100 10 110
'M 200 . 200
M 100 10 110
F 100 $0 150
F 200 10210
Answer: B
Question: 33
Which one of the following SAS SORT procedure options eliminates identical
consecutive observations?
A. NODUP
B. UNIQUE,
C. DISTINCT
D. NODUPKEY
Answer: A
Question: 34
The following SAS program is submitted:
data temp;
array points(3,2}_temporary_(10,20,30,40,50,60);
score = points(2,i} run;
‘Which one of the following is the value of the variable SCORE in the data set TEMP?
18 ‘tun ePianeabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Uae>
&g8s
Answ
Question: 35
The following SAS FORMAT procedure is submitted:
proc format lib = sasuser;
value tempe low < 0 = BELOW FREEZING’
run;
How is the value 10 displayed when the format TEMPC is applied?
AL10
B.MILD
C. WARM,
D. BELOW FREEZING
Answer: C
Question: 36
Which one of the following SAS programs uses the most amount of memory
resources for output buffers?
A. data new(bufsize = 1000 bufno = 5)
set temp;
run;
B. data new(bufsize = 1000 bufno = 2);
set temp; run;
C. data new(bufsize = 2000 bufno = 3);
set temp; run;
D. data new(bufsize = 4000 bufno = 1);
set temp; run;
Answer: C
Question: 37
Given the following SAS data sets ONE and TWO:
ONE TWO NUM CHARI NUM CHAR2
1A12X1
1A22X2(A00-202) SAS Advanced Programming Exam Study Guide
00-202
2BI3Y2
B25V4D
‘The following SAS program is submitted creating the output table THREE:
proc sql;
create table three as select one.num, charl, char? from one, two where one.num =
‘wo.num;
quit;
THREE NUM CHARI CHAR2
2BIXI
2B1X2
2B2X1
2B2X2
Which one of the following DATA step programs creates an equivalent SAS data set
THREE?
A. data three;
merge one two;
by num;
run;
B. data three;
set one;
set two;
by num;
run;
merge one two;
by num;
run;
C. data three;
set one;
set two;
by num;
run;
by num;
run;
D. data three;
set ont
do i= 1 to numobs;
set two(rename = (num = num2)) point = i nobs = numobs;
if num2 = num then output;
end;
drop num2;
run;
Answer: D
2 bios. ePiane_abs.com21
(A00-202) SAS Advanced Programming Exam Study Guide
A00-202
Question: 38
‘The following SAS program is submitted:
macro execute;
proc print data = sasuser.houses;
run;
end;
omend;
‘Which of the following completes the above program so that it executes on
Tuesday?
A. Sif &sysday = Tuesday %then %do;
B. %if &sysday = Tuesday’ gethen %do;
C. Sif "&sysday" = Tuesday Jethen Yodo;
D. if ‘&sysday' = Tuesday’ %ethen Yodo;
Answer: A
Question: 39
Which one of the following statements is true regarding a SAS DATA step vie}
A. It allows write capabilities.
B. It contains global statements.
C. It contains data and a descriptor portion.
D. It contains a partially compiled DATA step.
Answer: D
Question: 40
Given the following SAS data sets ONE and TWO:
ONE TWO OBS COMMON X OBS COMMON Y
1AIO1AL
2A 13243
3A143B4
4B94B2
5C85C5
6ci4
The following SAS DATA step is submitted:
data combine;
‘merge one two;
by common;
run;
Which one of the following represents the data values stored in data set
COMBINE?
‘A. OBS COMMON X Y
2 tt .PlanetLabs.com(A00-202) SAS Advanced Programming Exam Study Guide
‘Ago-202
1A101
2A133
3A143
4Bo4
5B92
6C85
70145
B. OBS COMMON X Y
1A101
2A 133
3B94
4C85C.
OBS COMMON X Y
1A101
2A133
3B 144
4B92
5C85
D. OBS COMMON X Y
1A101
2A131
3A141
4A103
5A 133
6A 143
7B94
8B929
C8510
C145
Answer: A
Question: 41
Assume today is Tuesday, July 23, 2002. Which one of the following statements
submitted at the beginning of a SAS session assigns the value Tuesday, July 23,
2002 to the macro variable START?
A, dolet start = today().weekdate.;
B. Sblet start = today(),format=weekdate.;
C. Solet start = Yosysfunc(today(),weekdate.);
D, dblet start = Ysysfunc(%today(), weekdate.);
Answer: C
2 Htguwwew.ePlanetLabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Question: 42
The following SAS program is submitted:
Fomacro test(var);
BLACKSMITH WORDSMITH SWORDSMITH:
Geindex( &jobs,&var);
Setest(SMITH)
‘Which one of the following is the resulting value of the macro variable TYPE?
AO
B.3
C6
D. null
Answer: C
Question: 43
Which one of the following SAS integrity constraint types ensures that a specific set
or range of values are the only values in a variable?
A. CHECK
B. UNIQUE
C. FORMAT
D. DISTINCT
Answer: A
Question: 44
Which one of the following options displays the value of a macro variable in the
SAS log?
A. MACRO
B. SOURCE
C, SOURCE2
D. SYMBOLGEN
Answer: D
Question: 45
The following SAS ARRAY statement is submitted:
array score{*) a4 - a10, a25 ; Which one of the following is the maximum number
of elements stored?
AB
B.7
C8
D.11
2 wy oP(A00-202) SAS Advanced Programming Exam Study Guide
‘00-202
Answer: C
Question: 46
When is it appropriate to create indexes on a SAS data set for efficient processing?
A. if small subsets of data are often retrieved
B. if the key variable has very few unique values
C. if the data are often used for BY group processing
D. if the SAS data set file page count is less than three pages
Answer: A
Question: 47
The following SAS program is submitted:
options yearcutoff = 1950;
emacro y2kopt(date);
Seif date >= 14610 then do;
options yearcutoft = 2000;
Send;
Geelse %edo;
options yearcutoff = 1900;
Geend;
omend;
data _null_;
date = "O1jan2000"¢;
call symput("date" Jeft(date));
run;
ey 2kopt(&edate)
‘The SAS date for January 1, 2000 is 14610 and the SAS system option for
YEARCUTOFF is set t0 1920 prior to submitting the above program. Which one of
the following is the value of YEARCUTOFF when the macro finishes execution?
A. 1900
B. 1920
C. 1950
D. 2000
Answer: D
Question: 48
Which one of the following is the purpose of the REUSE= YES option in a
compressed SAS data set?
A. It temporarily compresses observations in a SAS data set
B. Itallows users to update the same SAS data set concurrently.
C. Itallows new observations to be inserted wherever enough free space exists.
2 hitp:ww.ePlanetLabs.com
24(A00-202) SAS Advanced Programming Exam Study Guide
‘00-202
D. It specifies that a new empty data set with a given name replaces an existing data
set with the same name,
Answer: C
Question: 49
Given the following SAS data set ONE:
ONE LEVEL AGE
110
220
320
210
110
230
310
220
330
110
The following SAS program is submitted:
roc sql;
select level,
max(age) as MAX from one group by level having max(age) >
(select avg(age) from one);
quit;
Which one of the following reports is generated?
A. LEVEL AGE
2.20320
B. LEVEL AGE
220330D.
LEVEL MAX
230330
Answer: D
Question: 50
‘Which one of the following is true regarding the KEEP statement?
A. The KEEP statement is available in both the DATA and the PROC steps
- B. The KEEP statement selects the variables read from the input data set(s).
25 htouwwrw.ePlanetLbs.com
25(A00-202) SAS Advanced Programming Exam Study Guide
00-202
C. The KEEP statement applies to all data sets created within the same DATA step.
D, The KEEP statement applies only to the first data set created within the same
DATA step if more than one data set is created,
Answer: C
Question: 51
Which one of the following displays the definition of a stored SQL procedure view
in the SAS log?
A. ECHOVIEW option
B. EXPANDVIEW option
C. VALIDATE VIEW statement
D. DESCRIBE VIEW statement
Answer: D
Question: 52
‘The following SAS program is submitted:
data temp;
array points{2,3}_temporary_;
run;
Which one of the following is the maximum number of elements that are stored?
vom
Answer: D
Question: 53
Which one of the following is the purpose of the IDXNAME-= data set option?
A. Itinstructs SAS to name and store a specific index.
B. It instructs SAS to store an index in a particular location.
C. Iv instructs SAS to use a specific index for WHERE processing.
D. It instructs SAS to use any available index for WHERE processing.
Answer: C
Question: 54
The DICTIONARY.MACROS table stores information about which of the following?
EF fn. ePlanetLabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
A. user defined macro variables only
B. system defined macro variables only
C. both user and system defined macro variables
D. macros stored in the autocall macro library only
Answer: C
Question: 55
Given the following SAS data set named WORK.INTERNAT:
WORK.INTERNAT LOCATION SUM
USA 30 EUR 40
‘The following SAS program is submitted:
Gelet LOC = Usa;
proc sql;
select *
from internat where location =
quit;
‘Which one of the following is the result when the above code is executed on the above
data set?
‘&Loc";
A. A report is generated with one destination,
B. No report is generated as the case of the compared values is different.
C. No report is generated as the case of the macro variable name is different.
D. A report is generated with the two original observations as the where clause does
not work.
Answer: B
Question: 56
The following SAS program is submitted:
Folet a = cat;
emacro animal(a = frog);
Gelet a = bird;
Gemend;
‘Seanimal(a = pig) Yput ais &a;
Which one of the following is written to the SAS log?
Avais &a
B. ais cat
C.aispig
D. ais bird
nswer: B
a hitoztwew.ePlanetLabs.com
27(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Question: 57
The following SAS program is submitted:
proc sql;
select *
from dictionary.tables;
quit;
Which one of the following is reported?
‘A. metadata on all tables in all libraries
B. metadata on all tables in the WORK library only
C. metadata on all tables in the SASUSER library only
D. metadata on all tables in the DICTIONARY library only
The following SAS program is submitted:
data two;
set two (Keep = &var);
= &var * &x; run;
Which one of the following is the value of the variable Z when the program finishes,
execution?
A. ERROR_
B. 20 (as a numeric)
C. 20 (as a character)
D. . (missing numeric)
Answer: B
Question: 59
‘Which one of the following options is available for SAS macro debugging?
A. MLOGIC
B. MDEBUG
C. MSGLEVEL
D. MAUTOSOURCE,
Answer: A.
28 Hitosww.ePlanetLabs com(A00-202) SAS Advanced Programming Exam Study Guide
‘00-202
Question: 60
The following SAS program is submitted:
Geletfirst = yourname;
Get last = frst;
put &&Elast;
Which one of the following is the result in the log of the %PUT statement?
A. first
B. &first
C. yourname
D. &yourname
Answer: C
Question: 61
Given the following SAS data sets ONE and TWO:
ONE TWO YEAR QTR BUDGET YEAR QTR SALES
2001 3500
2001 4 300
2001 4400
2002 1 600
2002.1 700
‘The following SAS program is submitted: proc sql;
select one.*, sales
from one left join two on one.year = two.year; quit;
Which one of the following reports is generated?
A. YEAR QTR BUDGET SALES
2001 3 500
B. YEAR QTR BUDGET SALES
2001 4 400 300
2002 1 700 600
C. YEAR QTR BUDGET SALES
2001 3 500
2001 4.400 300
2002 1 700 600
D. YEAR QTR BUDGET SALES
2001 3 500 300
2001 4.400 300
2002 1 700 600
Answer: D
2 htpsivmew.ePtanet abs.com
2930
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Question: 62
Given the following SAS data sets ONE and TWO:
proc sql:
ONE TWO OBS COMMON X OBS COMMON Y
1A101A1
2A132A3
3A143B4
4B94B25
C8SC56C14
‘The following SAS DATA step is submitted:
data combine;
run;
‘Which one of the following represents the data values stored in data set COMBINE?
A. OBS COMMON X Y
1A101
2A133
3A143
4Bo4
5B92
6C85
7C145
B. OBS COMMON X Y
1A101
2A133
3B94
4c8s
C. OBS COMMON X Y
1AI01
2A133
3B144
4B92
5C85
D. OBS COMMON X Y
1A101
2A131
3A141
4A103
30 hips. ePlanetLas com3i
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
5A133
6A143
7B94
8B92
9c8s
loc i145
Answer: C
Question: 63
Given the following SAS program:
proc sql:
select product, type, sum(sales) as revenue
from one
group by product, type; quit;
Which one of the following clauses should be added to the program to sort the output
by PRODUCT and decreasing REVENUE?
A. order by 1,3
B. order by 1, 3 dese
C. orderby product, revenue dese
D. order by product, desc revenue
Answer: B
Question: 64
‘The following SAS program is submitted:
emacro testvar);
proc print data = sasuser.class; where age > &var;
run;
Somend;
Which type of parameter is the macro variable VAR?
A. default
B. keyword
C. positional
D. command
Answer: C
Question: 65
The following SAS program is submitted:
proc datasets lib = testdata;
modify one;
abel num = Number’;
format num
a {io:dnu lanl abs.com(A00-202) SAS Advanced Programming Exam Study Guide
0.202
quit;
Which one of the following SQL programs produces the same results as the above
DATASETS procedure?
A. proc sql;
modify table testdata.one num format = 4. label
quit;
B. proc sql;
alter table testdata.one modify num format = 4. label = ‘Number’;
quit;
C. proc sql;
modify table testdata.one alter num format = 4. label = ‘Number’;
quit;
D. proc sql;
alter table testdata.one modify num (format =
quit
‘Number’;
label = ‘Number’;
Answer: B
Question: 66
Which one of the following SAS integrity constraint types ensures that a specific set
cor range of values are the only values in a variable?
A. CHECK
B. UNIQUE,
C. FORMAT
D. DISTINCT.
Answer: A
Question: 67
‘Which one of the following automatic SAS macro variables contains the return code
from a previously executed step?
A. &RC
B. &ERR
C. &SYSRC
D. &SYSERR
Answer: D
Question: 68
Which one of the following statements is true?
A. The WHERE statement can be executed conditionally as part of an IF statement.
B. The WHERE statement selects observations before they are brought into the PDV.
2 ‘itovmePtanet abs com(A00-202) SAS Advanced Programming Exam Study Guide
00.202
C. The subsetting IF statement works on observations before they are read into the
PDV.
D. The WHERE and subsetting IF statements can be used interchangeably in all SAS
programs.
Answer: B
Question: 69
Which one of the following should be avoided when creating and using an SQL
procedure view?
A. using a HAVING clause
B. using summary functions
. referencing a view multiple times in the same program
D. creating views on tables whose structures remain constant
Answer: C
Question: 70
Given the following SAS data sets ONE and TWO:
ONE TWO NUM COUNTRY NUM CITY
1 CANADA 3 BERLIN
2 FRANCE 5 TOKYO
3 GERMANY
4 BELGIUM
5 JAPAN
The following SAS program is submitted:
proc sql;
select country
from one
‘where not exists (select * from two where one.num = two.num);
quit;
Which one of the following reports is generated?
A. COUNTRY
GERMANY
JAPAN
B, COUNTRY
FRANCE
BELGIUM
C. COUNTRY
38 www ePlanetLabs com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
CANADA
FRANCE
BELGIUM
D. COUNTRY
CANADA
FRANCE
GERMANY
Answer: C
Question: 71
‘Text is sent to the SAS compiler as a result of macro execution. Which one of the
following SAS system options writes that text to the log?
A. MPRINT
B. MLOGIC
C. MSOURCE
D. SOURCE2
Answer: A
Question: 72
Given the following SAS data set ONE:
ONE JOB LEVEL SALARY
ACC2300
SEC 1 100
SEC 2 200
MGR 3 700
ACCI
ACC3
MGR 2 400
The following SAS data set TWO is created:
‘TWO JOB LEVEL BONUS
ACC 2.30
MGR 3 70
MGR 240,
Which one of the following SAS programs creates data set TWO?
A. proc sql;
create table two as
select job, level, salary * 0.1 as bonus
from one where bonus > 20;
u hitpwiwa.ePtanetLbs com
34(A00-202) SAS Advanced Programming Exam Study Guide
00-202
quit
B. proc sql;
create table two as
select job, level, salary * 0.1 as bonus
from one where salary > 20;
quit;
C. proc sql:
create table two as
select job, level, salary * 0.1 as bonus
from one where calculated salary * 0.1 > 20;
quit;
D. proc sql;D.proc sql;
create table two as
select job, level, salary * 0.1 as bonus
from one where calculated bonus > 20;
quit:
Answer: D
Question: 73
Which one of the following options is available for SAS macro debugging?
A. MLOGIC
B. MDEBUG
C. MSGLEVEL
D. MAUTOSOURCE
Answer: A.
Question: 74
‘The following are values of the variable STYLE from the SAS data set
SASUSER HOUSES:
SASUSERS.HOUSES OBS STYLE
1 RANCH
2 SPLIT
3 CONDO
4 TWOSTORY
S RANCH
6 SPLIT
7 SPLIT
The following SAS program is submitted:
proc sql noprint;
select distinct style
into :styles separated by "*
% fitpuhvrwaPianatLabs com
35(A00-202) SAS Advanced Programming Exam Study Guide
‘A00-202
from sasuser.houses order by style;
quit:
Which one of the following is the value of the resulting macro variable?
A. CONDO RANCH SPLIT TWOSTORY
B. RANCH SPLIT CONDO TWOSTORY
C, CONDO RANCH RANCH SPLIT SPLIT SPLIT TWOSTORY
D. RANCH SPLIT CONDO TWOSTORY RANCH SPLIT SPLIT
‘Answer: A
Question: 75
‘The following SAS program is submitted:
Gelet value
Golet add = 5;
Gblet newval = Yeval(&value + &add);
Which one of the following is the resulting value of the macro variable NEWVAL?
Answer: D
Question: 76
The following SAS program is submitted: proc sql;
select *
from dictionary.tables;
quits
Which one of the following is reported?
‘A. metadata on all tables in all libraries
B. metadata on all tables in the WORK library only
CC. metadata on all tables in the SASUSER library only
D, metadata on all tables in the DICTIONARY library only
Answer: A
Question: 77
‘Which one of the following is true regarding the KEEP statement?
A. The KEEP statement is available in both the DATA and the PROC steps
B. The KEEP statement selects the variables read from the input data set(s).
6 wy. 0P com
36(A00-202) SAS Advanced Programming Exam Study Guide
00-202
C. The KEEP statement applies to all data sets created within the same DATA step.
D. The KEEP statement applies only to the first data set created within the same
DATA step if more than one data set is created.
Answer: C
Question: 78
The following SAS program is submitted:
Geet lib = Youpcase(sasuser);
proc sqli
select nvar
from dictionary tables
where libname = "lib";
quit;
Given that several SAS data sets exist in the SASUSER library, which one of the
following is generated as output?
A. no result set
B. a syntax error in the log
C. a report showing the names of each table in SASUSER
D. areport showing the number of columns in each table in SASUSER
Answer: D
Question: 79
Which one of the following SAS programs displays the descriptor portion of each
data set stored in the SASUSER library?
sasuser.all;
asuser._all_;
quit;
C. proc datasets lib = sasuser; contents data = all;
quit:
D. proc datasets lib = sasuser; contents data
quit;
all;
Answer: D
Question: 80
‘The following SAS program is submitted:
sasuser.class; where age > &var;
Somend;
‘Which type of parameter is the macro variable VAR?
3738
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
A. default
B. keyword
C. positional
D. command
Answer: C
Question: 81
Given the following SAS data sets ONE and TWO:
ONE TWO OBS COMMON X OBS COMMON Y
1AI01A1
2A132A3
3A143B4
4B94B2
5C85C5S
6c 14
The following SAS DATA step is submitted
data combine;
set one;
set two;
Which one of the following represents the data values stored in data set
COMBINE?
A. OBS COMMON X Y
LA101
2A 133
3A 143
4B94
5B92
6C85
710145
B. OBS COMMON X Y
1A101
2A133
3B94
4c8s
C. OBS COMMON X Y
TA101
2A133
3B 144
4B92
38 Hitoutww.ePlanetLabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
5C85
D. OBS COMMON X Y
1A101
2A131
3A141
4A103
5A133
6A143
71B94
8B92
9C8510
c14s
Answer: C
Question: 82
The following SAS program is submitted:
options yearcutofi = 195
omacro y2kopt(date);
Gif date >= 14610 %then %do;
options yearcutoft = 2000;
Send;
Gelse “edo:
options yearcutoff = 1900;
Goends;
Fomends
data _null_;
date = "01jan2000"4;
call symput("“date" left(date));
run;
Sey2kopt(&edate) The SAS date for January 1, 2000 is 14610 and the SAS system option
for YEARCUTOFF is set to 1920 prior to submitting the above program. Which one of
the following is the value of YEARCUTOFF when the macro finishes execution?
A. 1900
B. 1920
C. 1950
D. 2000
Answer: D
Question: 83
Which one of the following options displays the value of a macro variable in the SAS
log?
9 bipsvmuw.ePtanetL.abs oom
39(A00-202) SAS Advanced Programming Exam Study Guide
00-202
A. MACRO
B, SOURCE
C. SOURCE?
D. SYMBOLGEN
Answer: D
Question: 84
The following SAS program is submitted:
Somacro test(var);
Jolet jobs = BLACKSMITH WORDSMITH SWORDSMITH;
Solet type = %index(&jobs, var);
‘mend;
‘Yetest(SMITH) Which one of the following is the resulting value of the macro variable
TYPE?
Answer: C
Question: 85
The following SAS program is submitted:
omacro execute;
proc print data = sasuser houses;
run;
end;
Semend;
Which of the following completes the above program so that it executes on Tuesday?
A. if &sysday = Tuesday Sethen %do:
B. Sif &sysday = Tuesday’ fethen do;
C. if "&sysday” = Tuesday Sothen %do;
D. Sif &sysday’ = Tuesday’ fothen %do;
Answer: A.
Question: 86
‘The following SAS program is submitted:
data temp;
array points(2,3}_temporary_;
run;
Which one of the following is the maximum number of elements that are stored?
0 ho: /Wwaw.ePlanetL.abs com
40(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Sow>
‘Answer: D
Question: 87
Given the following SAS data set ONE:
ONE REP COST
SMITH 200
SMITH 400
JONES 100
SMITH 600
JONES 100
JONES 200
JONES 400
‘SMITH 800
JONES 100
JONES 300
‘The following SAS program is submitted:
proc sql;
select rep, avg(cost) as AVERAGE,
from one group by rep having avg(cost) > (select avg(cost) from one);
quit;
‘Which one of the following reports is generated?
A. REP AVERAGE,
JONES 200
B. REP AVERAGE
JONES 320
C. REP AVERAGE
SMITH 320
D. REP AVERAGE,
‘SMITH 500
Answer: D
Question: 88
Given the following SAS program: proc sql;
select product, type, sum(sales) as revenue
a hitosvnew.ePtanetLabs.com
41(A00-202) SAS Advanced Programming Exam Study Guide
00-202
from one group by product, type;
quit
Which one of the following clauses should be added to the program to sort the output by
PRODUCT and decteasing REVENUE?
A. order by 1,3
B. order by 1, 3 dese
C. orderby product, revenue dese
D. order by product, desc revenue
Answer: B
Question: 89
The following SAS program is submitted:
Gelet name = Patel's Restaurant;
‘Which one of the following statements avoids problems associated with the unbalanced
quotation mark?
A. Solet nam
B, %let name
Patel%'s Restaurant;
str(Pate’s Restaurant);
C. let name = Patel%str(’)s Restaurant;
D, %let name = %str(Patel%'s Restaurant);
Answer: D
Question: 90
The following SAS program is submitted:
Solet var = chicago, 1;
data a;
ew york, 2';
newvar = Sescan(&var,2, %str());
run;
Which one of the following explains why the program fails to execute?
A. The %STRO is invalid syntax.
B. The %SCAN function does not exist.
C. The %SCAN function has too many arguments,
D. The macro variable VAR does not get created properly.
Answer: C
Question: 91
Which one of the following is an advantage of creating and using a SAS DATA step
view?
A. It can store an index.
2 hitpstwew.ePlanetLabs.com
42(A00-202) SAS Advanced Programming Exam Study Guide
00-202
B. Italways accesses the most current data,
C. It works quickly through multiple passes of the data.
D. Itis useful when the underlying data file structure changes.
Answer: B
Question: 92
The following SAS program is submitted:
data one;
doi=1to 10;
ptobs = ceil(ranuni(0) * totobs);
Set temp point = ptobs nobs = totobs:
‘output; end:
stop;
run;
The SAS data set TEMP contains 2,500,000 observations. Which one of the following
represents the possible values for PTOBS?
‘A any integer between 1 and 10
B. any real number between 0 and |
C. any integer between 1 and 2,500,000
D. any real number between | and 2,500,000
Answer
Question: 93
Given the following SAS data sets ONE and TWO:
ONE TWO YEAR QTR BUDGET YEAR QTR SALES
2001 3 500
2001 4 300
2001 4.400
2002 1 600
2002 1700
The following SAS program is submitted:
proc sql;
select one.*, sales
from one, two
where one.year = two.year;
quit;
Which one of the following reports is generated?
A. YEAR QTR BUDGET SALES
2001 4.400 300
2002 1 700 600
8 tps. ePiantabs com
43(A00-202) SAS Advanced Programming Exam Study Guide
00-202
B. YEAR QTR BUDGET SALES
2001 3 500
2001 4.400 300
2002 1 700 600
C. YEAR QTR BUDGET SALES
2001 3 500 300
2001 4.400 300
2002 1 700 600
D. YEAR QTR BUDGET SALES
2001 3 $00 300
2001 4 400 300
2002 1 700 300,
2001 3 500 600
2001 4 400 600
2002 1 700 600
Answer: C
Question: 94
The following SAS program is submitted:
proc contents data = testdata.one;
run;
‘Which one of the following SQL statements produces similar information about the
column attributes as the above CONTENTS procedure?
A. proc sql;
show testdata.one;
quit;
B. proc sql:
describe testdata.one;
quit;
C. proc sql:
show table testdata.one;
quit;
E. proc sql;
describe table testdata.one;
quit;
Answer: D
Question: 95
The following SAS code is submitted:
‘macro houses(dsn = houses,sub = RANCH);
4 hip:/www.ePtanetabs com45
(A00-202) SAS Advanced Program
1g Exam Study Guide
00-202
data &dsn; set sasuser-houses;
if style = "&esub";
run;
Gomend;
ehouses(sub = SPLIT) S%houses(dsn = ranch) %houses(sub = TWOSTORY) Which one
of the following is the value of the automatic macro variable SYSLAST?
A. work.ranch
B. work.houses
C. WORK.RANCH
D. WORK.HOUSES
Answer: D
Question: 96
Which one of the following programs contains a syntax error?
A. proc sql;
select product.*, cost.unitcost, sales.quantity
from product p, cost c, sales s
c.item and p.item
item; quit;
select product.*, cost.unitcost, sales.quantity
from product, cost, sales
where product.item = cost.item and product.item = sales.item;
quit;
C. proc sql;
select p.*, c-unitcost, s.quantity
from product as p, cost as ¢, sales as s
where p.item = c.item and p.item = s.item;
quit
D. proc sql;
select p.*, ¢.unitcost, s.quantity
from product, cost, sales
where product item = cost.item and product item = sales.item;
quit;
Answer: D
Question: 97
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?
ry hitouw.ePlanetLabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
A.10
B.20
C.30
D. 40
Answer: C
Question: 98
Which one of the following statements is true regarding a SAS DATA step view?
A. Itallows write capabilities.
B. It contains global statements.
. It contains data and a descriptor portion.
D. Itcontains a partially compiled DATA step.
Answer: D
Question: 99
Given the following SAS data sets ONE and TWO:
ONE TWO YEAR QTR BUDGET YEAR QTR SALES
2001 3 500
2001 4 300
2001 4 400
2002 1 600
2002 1 700
The following SAS program is submitted:
proc sql;
select one.*, sales
from one left join two on one.year = two.year
quit;
Which one of the following reports is generated?
A. YEAR QTR BUDGET SALES
2001 3 500.
B. YEAR QTR BUDGET SALES
2001 4.400 300
2002 1 700 600
C. YEAR QTR BUDGET SALES
2001 3 500
2001 4.400 300
2002 1 700 600
D. YEAR QTR BUDGET SALES
2001 3 500 300,
6 hitouwww.ePlanetLabs.com
46(A00-202) SAS Advanced Programming Exam Study Guide
00-202
2001 4 400 300
2002 1 700 600
Answer: D
Question: 100
Given the following SAS data set ONE:
ONE COUNTRY CITY VISIT
USA BOSTON 10
UK LONDON 5
USA DALLAS 10
UK MARLOW 10
USA BOSTON 20
UK LONDON 15
USA DALLAS 10
The following SAS program is submitted:
proc sql;
select country, city, sum(visit) as TOTAL
from one group by country, city order by country, total dese;
quit;
Which one of the following reports is generated?
A. COUNTRY CITY TOTAL
UK MARLOW 10
UK LONDON 20
USA BOSTON 50
USA DALLAS 20
B. COUNTRY CITY TOTAL
UK LONDON 20
UK MARLOW 10
USA BOSTON 50
USA DALLAS 20
C. COUNTRY CITY TOTAL
USA BOSTON 50
USA DALLAS 20
UK LONDON 20
UK MARLOW 10
D. COUNTRY CITY TOTAL
UK MARLOW 10
UK LONDON 20
a hitowwww.ePlanetLabs.com
47(A00-202) SAS Advanced Programming Exam Study Guide
‘00-202
USA DALLAS 20
USA BOSTON 50
Answer: B
Question: 101
‘The DICTIONARY. MACROS table stores information about which of the following?
‘A. user defined macro variables only
B. system defined macro variables only
C. both user and system defined macro variables
D, macros stored in the autocall macro library only
Answer: C
Question: 102
Given the following SAS data set ONI
ONE DIVISION SALES
A 1234
A 3654
B 5678
‘The following SAS program is submitted:
data _null_;
set one;
by division;
if firstdivision then call symput('mfirst’ sales);
if last division then call symput(‘mlast’sales);
run;
Which one of the following is the value of the macro variable MFIRST when the above
program finishes execution?
A. null
B. 1234
C. 3654
D. 5678
Answer: D
Question: 103
Given the following SAS data sets ONE and TWO:
ONE TWO NUM CHARI NUM CHAR?
1a2x
2B3Y
4DSV
The following SAS program is submitted creating the output table THREE:
48 hitoswn.ePtanetLabs.com
48(A00-202) SAS Advanced Program:
00-202
data three;
set one two;
run;
THREE NUM CHARI CHAR2
1A
2B
4D
2x
3Y
5V
Which one of the following SQL programs creates an equivalent SAS data set THREE?
A. proc sql;
create table three as
select *
from one outer union corr
select *
from two;
quit;
B. proc sql;
create table three as
select *
from one outer union
select * from two;
quit;
C. proc sql:C.proc sql;
create table three as
select *
from one union
select *
from two;
quit; D. proc sql;
Deproc sql:
create table three as
select *
from one union corr
select *
from two;
quit:
Answer: A.
Question: 104
Which one of the following statements about compressed SAS data sets is always true?
4“ npn Plane abs cor
49(A00-202) SAS Advanced Programming Exam Study Guide
00.202
A. Each observation is treated as a single string of bytes.
B. Each observation occupies the same number of bytes.
C. An updated observation is stored in its original location.
D. New observations are added to the end of the SAS data set.
Answer: A
Question: 105
Given the following SAS data sets ONE and TWO:
ONE TWO NUM CHARI NUM CHAR2
1A12X1
1A22X2
2B13Y
2B25V
4D
The following SAS program is submitted creating the output table THREE:
proc sql:
create table three as
select one.num, charl, char
from one, two where one.num = two.num;
quit;
THREE NUM CHARI CHAR2
2B1X1
2BI x2
2B2X1
2B2X2
Which one of the following DATA step programs creates an equivalent SAS data set
THREE?
A. data three;
‘merge one two;
by num;
run;
B. data three;
set one;
set two;
by num;
run; C. data three;
C.data thres
merge one (in = in!) two (in = in2);
by num;
if int and ind;
run; D. data three;
D.data three;
0 hiozimuy.ePlanetLabs com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
set one;
doi = 1 tonumobs;
set two(rename = (num = num2)) point = i nobs = numobs;
if num2 = num then output;
end;
drop num2;
run;
Answer: D
Question: 106
Given the following SAS data set ONE:
ONE LEVEL AGE
110
220
320
210
110
230
310
220
330
110
‘The following SAS program is submitted:
proc sql;
select level, max(age) as MAX from one group by level having max(age) >
(select avg(age)
from one);
Which one of the following reports is generated?
A. LEVEL AGE
330
D. LEVEL MAX
230
51 Hig: ePlanetLabs.com
31(A00-202) SAS Advanced Program:
00-202
330
Answer: D
Question: 107
‘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;
1um(price * quantity);
totcost = sum(fixed, variable);
profit = sum(totrev,otcost);
if totrev > 1000;
run;
B. data two;
set one;
uum(price * quantity);
if totrev > 1000;
totcost = sum(fixed,variable)
1um(totrev,otcost);
C. data two;
set one;
totrev = sum(price * quantity);
where 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;
Answi
Question: 108
Given the following SAS data set ONE:
ONE CATEGORY AGE SALARY BONUS
M 28 200 20
M25 100 10
2 ilps. ePtanetLabs.com53
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
M 28 300 10
M33 30030
F 18 100.50
F 25 200 10
F 35 400 50
The following SAS program is submitted: proc sql;
select distinct category, sum(sum(salary,bonus)) as EARNINGS
from one
where age < 30 group by category having calculated EARNINGS < 500;
quit;
Which one of the following reports will be generated?
A. CATEGORY EARNINGS
F360
B. CATEGORY EARNINGS
M640
F360
C. CATEGORY EARNINGS
F150
F210
D. CATEGORY EARNINGS
M220
M110
M310
F150
F210
Answer: A
Question: 109
Which one of the following is the purpose of the IDXNAMEz= data set option?
A. ILinstructs SAS to name and store a specific index.
B. It instructs SAS to store an index in a particular location.
C. It instructs SAS to use a specific index for WHERE processing.
D. Itinstructs SAS to use any available index for WHERE processing,
Answer: C
Question: 110
The SAS data set ONE contains the variables X, Y, Z, and W. The following SAS
program is submitted: proc transpose data = one out
by x;
3 bp ePtanet_abs com54
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
var y;
run;
Which one of the following contains all the names of the columns created by the
TRANSPOSE procedure?
A.XY,Z, and W
B._NAME_, X, and Y
C. new, X, and COLI
D. new, X,Y, and_COLI
— Answer: C
Question: 111
Which of the following statement(s) in the DATASETS procedure alters the name of @
SAS data set stored in a SAS data library?
‘A. RENAME statement only
B. CHANGE statement only
C. MODIFY and RENAME statements
D. MODIFY and CHANGE statements
Answer: B
Question: 112
Given the following SAS data set SASUSER HIGHWAY: SASUSER. HIGHWAY
STEERING SEATBELT SPEED STATUS COUNT
absent no 0-29 serious 31
absent no 0-29 not 1419
absent no 30-49 serious 191
absent no 30-49 not 2004
absent no 50+ serious 216
The following SAS program is submitted:
emacro highway;
proc sql noprin
select count(distinet status)
into :numgrp
from sasuser highway;
Selet numgrp = &numgrp;
select distinct status into :
group! ~:group&numgrp
from sasuser-highway;
quit;
Feddo i = 1 Sto &numgrp;
Proc print data = sasuser-highway;
where status = "&&groupaei” ;
run;
5 bpm. ePanetLabs com55
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
end;
Fomend;
Sehighway
How many reports are produced by the above program?
0
A.
B,
c
D.
DS
Answer: C
Question: 113
The SAS data set TEMP has the following distribution of values for variable A:
A Frequency
1 500,000
2,500,000
67,000,000
83,000
Which one of the following SAS programs requires the least CPU time to be
processed?
A. data new;
set temp;
if a=8 then b = "Small
else if a in(1, 2) then b= Medium’;
else if a= 6 then b = ‘Large’;
run;
B. data new;
set temp;
ifain (1, 2) then
else if a=8 then
else if a=6 then
run;
C. data new;
set temp;
if a=6 then b = ‘Largs
else if a in (1, 2) then
else if a= 8 then
run;
D. data new;
D.data new;
set temp;
if a =6 then b= "Large
if ain (1, 2) then b = 'Medium’;
ifa=8 thend
small’
55 bps. Pant abs.com56
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
run;
Answer: C
Question: 114
The following SAS program is submitted. filename sales (‘extenal-file!" ‘external-
file2');
data new;
infile sales;
input date date9, company $ revenue;
run;
‘Which one of the following is the result of including the FILENAME statement in this,
program?
A. The FILENAME statement produces an ERROR message in the SAS log,
B. The FILENAME statement associates SALES with external-file2 followed by
external-filel
C. The FILENAME statement associates SALES with external-filel followed by
external-file2.
D. The FILENAME statement reads record | from external-file 1, reads record 1
from external-file 2, and combines them into one record.
Answer: C
Question: 115
Which one of the following options controls the pagesize of a SAS data set?
A. SIZE=
B. BUFNO:
C. BUFSIZI
D. PAGESIZE=
Answer: C
Question: 116
Given the following SAS data set ONE:
ONE CATEGORY AGE SALARY BONUS
M 28 200 20
M25 100 10
M 28 300 10
M33 30030
F 18 10050
F 25 200 10
F 35 400 50
8 tigsiwwePIanet abs com57
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
The following SQL program is submitted:
proc sql;
cteate table two as
select distinct age
from one where age < 33;
quit;
How many rows are written to the SAS data set TWO?
A3
pae
4
a5
. 6
Answer: A
Question: 117
The following SAS program is submitted:
data two;
run;
Which one of the following is the value of the variable Z when the program finishes
execution?
A. ERROR_
B. 20 (as a numeric)
C. 20 (as a character)
)
Answer: B
Question: 118
Given the following SAS statement:
%let ideode = Prods67;
Which one of the following statements stores the value $67 in the macro variable
CODENUM?
A. let codenum = substr(&idcode,length(&idcode)-2):
B. %let codenum = subst &idcode,length(&ideode)-3);
C. %let codenum = Sesubstr( &idcode, Ylength(&idcode)-2);
D. Selet codenum = %substr( &idcode, Zolength &idcode)-3
Answer: C
a nos www.ePianeabs.com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
Question: 119
The following SAS program is submitted:
Gelet a=
emacto animal(a = frog);
elet a = bird;
omen,
Foanimal(a = pig) Yeput ais &a;
Which one of the following is written to the SAS log?
Avais&a
B. ais cat
C.ais pig
D.aisbird
Answer: B
Question: 120
Which one of the following is the purpose of the REUSE= YES option in a
compressed SAS data set?
A. It temporarily compresses observations in a SAS data set.
B. It allows users to update the same SAS data set concurrently.
C. It allows new observations to be inserted wherever enough free space exists.
D. It specifies that a new empty data set with a given name replaces an existing data
set with the same name.
Answer: C
Question: 121
In which one of the following SAS programs is the SAS data set index named
CHARI always used?
‘A. data three; set one; set two key = char1; run;
B. data three; set one; if char! in (‘new york’ ‘los angeles’); run;
C. data three; set one; where charl in (‘new york’ los angeles’);
run;
D. proc sql; create table three as
select *
from one, two where one.charl > two.charl;
quit;
Answer: A
Question: 122
58 bitpsvmww.ePtanetLabs com
5859
(A00-202) SAS Advanced Programming Exam Study Guide
00-202
The following SAS program is submitted:
Sblet first = yourname;
let last = first;
put &c& last;
Which one of the following is the result in the log of the %PUT statement?
A. first
B. &first
C. yourname
D. &yourname
Answer: C
Question: 123
The following SAS program is submitted:
data new (bufsize = 6144 bufno = 4);
set old;
run;
‘Which one of the following describes the difference between the usage of BUFSIZE=
and BUFNO= options?
A. BUFSIZE= specifies the size of the input buffer in bytes;
BUFNO= specifies the number of input buffers.
B. BUFSIZE= specifies the size of the output buffer in bytes;
BUFNO= specifies the number of output buffers.
B. BUFSIZE= specifies the size of the output buffer in kilobytes;
BUFNOs= specifies the number of input buffers.
C. BUFSIZE= specifies the size of the output buffer in kilobytes;
BUFNO= specifies the number of output buffers.
Answer:
Question: 124
Which one of the following SAS SORT procedure options eliminates identical
consecutive observations?
A. NODUP
B, UNIQUE
C. DISTINCT
D. NODUPKEY
Answer: A
Question: 125,
Which one of the following techniques concatenates data in SAS?
A. the APPEND procedure
59 itp: ePlanetLads.com(A00-202) SAS Advanced Programming Exam Study Guide
poo2ne
B. the DATA step with a MERGE statement
C. the DATA step with a COMBINE statement
D, the INTERSECT operator in the SQL procedure
Answer: A.
Question: 126
Given the following SAS data sets ONE and TWO:
ONE TWO YEAR QTR BUDGET YEAR QTR SALES
2001 3 500
2001 4 300
2001 4 400
2002 1 600
2002 1 700
The following SAS program is submitted: proc sql;
select one.*,
sales from one, two:
quit;
Which one of the following reports is generated?
A. YEAR QTR BUDGET SALES
2001 4 400 300
2002 1 700 600
B. YEAR QTR BUDGET SALES
2001 3500.
2001 4 400 300,
2002 1 700 600
C. YEAR QTR BUDGET SALES
2001 3 500 300
2001 4.400 300
2002 1 700 600
D. YEAR QTR BUDGET SALES
2001 3 500 300
2001 4 400 300
2002 1 700 300
2001 3 500 600
2001 4 400 600
2002 1 700 600
Answer: D
Question: 127
‘Which one of the following SAS programs uses the most amount of memory resources for output
Cd htovAwmePIanetL.abs com(A00-202) SAS Advanced Programming Exam Study Guide
00-202
butters?
A. data new(bufsize = 1000 butno
set temp;
run;
B. data new(butsize
set temp;
run;
C. data new(butsize = 2000 butno = 3);
set temp;
run;
D. data new(bufsize =
set temp;
run;
1000 bufno = 2);
1000 butno = 1);
Answer: C
Question: 128
The following SAS FORMAT procedure is submitted:
proc format lib = sasuser,
value tempe low < 0 = 'BELOW FREEZING’
0<5='COLD’
16 high = "HOT;
tun;
How is the value 10 displayed when the format TEMPC is applied?
Ato
B MILD
C. WARM
D. BELOW FREEZING
Answer:
Question: 129
‘When s it appropriate to create indexes on a SAS data set for efficient processing?
Ai small subsets of data are often retrieved
B. ifthe key variable has very few unique values
C. ifthe data are often used for BY group processing
D. ifthe SAS data set file page count is less than three pages
Answer: A
Question: 130
‘The following SAS ARRAY statement is submitted:
array score{"} a4 - a10, a25 ;
Which one ofthe following is the maximum number of elements stored?
pomp
Answer: C
a titowwwn.ePlanetLabs.com
61