A00-212: SAS Advanced Programming Exam for SAS 9
1. Given the SAS data sets ONE and TWO: ONE TWONUM COUNTRY NUM CITY 1 CANADA 3 PARIS
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
report is generated? A.COUNTRYFRANCEJAPAN
B.COUNTRYGERMANYJAPAN
C.COUNTRYCANADAFRANCEBELGIUM
D.COUNTRY FRANCEGERMANYBELGIUM
Answer: C
2. Given the SAS data set ONE: ONEREP COST SMITH 200 SMITH 400 JONES 100 SMITH 600
JONES 100 The following SAS program is submitted: proc sql; select rep, avg(cost) as AVERAGE from
one group by rep quit; The following output is desired: REP AVERAGE SMITH 400 Which SQL procedure
clause completes the program and generates the desired output?
A.having avg(cost) < select avg(cost) from one);
B.where avg(cost) > (select avg(cost) from one);
C.having avg(cost) > (select avg(cost) from one);
D.where calculated average > (select avg(cost) from one);
Answer: C
3. Given the SAS data sets ONE and TWO: ONETWO YEARQTRBUDGETYEARQTRSALES 20013
50020014 300 20014 40020021 600 20021 700 The following SAS program is submitted: proc sql; select
one.*, sales from one left join two on one.year = two.year where one.year=2001; quit; Which report is
generated? A.YEAR QTR BUDGET SALES 2001 3 500 . 2001 4 700 600
B.YEAR QTR BUDGET SALES 2001 3 500 300 2001 4 400 300
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 . 2001 4 400 300 2001 4 . 300
Answer: B
4. The following SAS program is submitted: proc contents data = testdata.one; run; Which SQL
procedure program produces similar information about the column attributes of the dataset
TESTDATA.ONE?
A.proc sql; contents testdata.one; quit;
B.proc sql; describe testdata.one; quit;
C.proc sql; contents table testdata.one; quit;
D.proc sql; describe table testdata.one; quit;
Answer: D
