SAS Institute A00-212 - SAS Advanced Programming for SAS 9 Exam
Page: 2 / 37
Total 184 questions
Question #6 (Topic: Single Topic)
The following SAS program is submitted:
%micro test(var);
%let jobs=BLACKSMITH WORDSMITH SWORDSMITH;
%let type=%index(&jobs, &var);
%put type = &type;
%mend;
%test(SMITH)
What is the value of the macro variable TYPE when the %PUT statement executes?
%micro test(var);
%let jobs=BLACKSMITH WORDSMITH SWORDSMITH;
%let type=%index(&jobs, &var);
%put type = &type;
%mend;
%test(SMITH)
What is the value of the macro variable TYPE when the %PUT statement executes?
A. 0
B. Null
C. 6
D. 3
Answer: C
Question #7 (Topic: Single Topic)
The following SAS program is submitted:
%macro check(num=4);
%let result=%eval(&nm gt 5);
%put result is &result;
%mend;
%check (num=10)
What is written to the SAS log?
%macro check(num=4);
%let result=%eval(&nm gt 5);
%put result is &result;
%mend;
%check (num=10)
What is written to the SAS log?
A. result is true
B. result is 10 gt 5
C. result is 1
D. result is 0
Answer: C
Question #8 (Topic: Single Topic)
The following SAS program is submitted:
data temp;
length 1 b 3 x;
infile 'file reference';
input a b x;
run;
What is the result?
data temp;
length 1 b 3 x;
infile 'file reference';
input a b x;
run;
What is the result?
A. The data set TEMP is not created because variables A and B have invalid lengths
B. The data set TEMP is created, but variable X is not created
C. The data set TEMP is not created because variable A has an invalid length
D. The data set TEMP is created and variable X has a length of 8
Answer: C
Question #9 (Topic: Single Topic)
Given the SAS data sets ONE and TWO:

The following SAS program is submitted:
Proc sql;
Select two.*,budget from one <insert JOIN operator here> two on one.year=two.year,
Quit;
The following output is desired:

Which JOIN operator completes the program and generates the desired output?

The following SAS program is submitted:
Proc sql;
Select two.*,budget from one <insert JOIN operator here> two on one.year=two.year,
Quit;
The following output is desired:

Which JOIN operator completes the program and generates the desired output?
A. FULL JOIN
B. INNER JOIN
C. LEFT JOIN
D. RIGHT JOIN
Answer: A
Question #10 (Topic: Single Topic)
Given the SAS data set SAUSER.HIGWAY:
SASUSER.HIGHWAY

The following SAS program is submitted:
%macro highway;
proc sql nonprint;
%let numgrp=6;
select distinct status into:group1-:group&numgrp from sasuser.highway;
quit;
%do i=1 %to &numgrp;
proc print data =sasuser.highway;
where status ="&&group&I";
run;
%end;
%mend;
%highway
How many reports are produced?
SASUSER.HIGHWAY

The following SAS program is submitted:
%macro highway;
proc sql nonprint;
%let numgrp=6;
select distinct status into:group1-:group&numgrp from sasuser.highway;
quit;
%do i=1 %to &numgrp;
proc print data =sasuser.highway;
where status ="&&group&I";
run;
%end;
%mend;
%highway
How many reports are produced?
A. 2
B. 6
C. 0
D. 5
Answer: A