Independence Day Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: netdisc

SAS Institute A00-212 SAS Advanced Programming Exam Practice Test

Demo: 27 questions
Total 184 questions

SAS Advanced Programming Questions and Answers

Question 1

This question will ask you to provide a missing reference.

Given the SAS data set SASUSER HIGHWAY:

The following SAS program is submitted:

What macro variable reference completes the program to create the WORK.NOT and WORK SERIOUS data sets?

Options:

A.

& Status & Count

B.

& & Status & i

C.

& & Status & Count

D.

& Status & i

Question 2

Given the SAS data sets:

The SAS program is submitted:

What output will be produced?

Options:

A.

Name

----------

Lauren

Smith

Patel

Farmer

Chang

Hiller

B.

Name

----------

Chang

Chang

Lauren

C.

Name

----------

Patel

Chang

D.

Name

----------

Lauren

Patel

Chang

Chang

Question 3

The following SAS program is submitted:

%let value=9;

%let add=5;

%let newval=%eval(&value/&add);

What is the value of the macro variable NEWVAL?

Options:

A.

null

B.

2

C.

1

D.

1.8

Question 4

Which one of the following SAS SORT procedure options eliminates identical consecutive observations?

Options:

A.

NODUP

B.

UNIQUE

C.

DISTINCT

D.

NODUPKEY

Question 5

The following SAS program is submitted:

How will the variable be listed?

Options:

A.

Height Weight Name Age

B.

Weight Height

C.

Weight Height Name Age

D.

Name Age Weight Height

Question 6

The following SAS program is submitted:

%macro test(var);

%let jobs = BLACKSMITH WORDSMITH SWORDSMITH;

%let type = %index(&jobs,&var);

%mend;

%test(SMITH)

Which one of the following is the resulting value of the macro variable TYPE?

Options:

A.

0

B.

3

C.

6

D.

null

Question 7

The following SAS program is submitted:

date view=sauser.ranch;

describe;

run;

What is the result?

Options:

A.

The program creates a DATA step view called SASUSER.RANCH and places the program cod in the current editor window

B.

The program retrieves the SAS source code that creates the view and places it in the output window

C.

The program creates a DATA step view called SASUSER.RANCH and places it in the

SAS log

D.

the program retrieves the SAS source code that creates the view and places it in the

SAS log

Question 8

The following SAS program is submitted:

%let first=yourname;

%let last=first;

%put &&&last;

What is written to the SAS Log?

Options:

A.

First

B.

Yourname

C.

&&First

D.

&yourname

Question 9

The following SAS program is submitted:

options mprint;

%macro test(parm);

proc &parm data = sashelp.prdsale;

run;

%mend;

%test(print)

What is the result of the MPRINT options?

Options:

A.

It has no effect in this example

B.

It writes the original program code inside the marco definition to the SAS log

C.

It writes macro execution messages to the SAS.log

D.

It echoes the text sent to the SAS compiler as a result of macro execution in the SAS log

Question 10

Which one of the following automatic SAS macro variables contains the return code from a previously executed step?

Options:

A.

&RC

B.

&ERR

C.

&SYSRC

D.

&SYSERR

Question 11

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?

Options:

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

SMITH SOUTH 200

C.

REP AREA TOTAL

JONES EAST 1

JONES NORTH 2

JONES WEST 3

SMITH NORTH 3

JONES WEST 3

SMITH NORTH 3

SMITH SOUTH 1

D.

REP AREA TOTAL

JONES EAST 1

JONES NORTH 2

JONES WEST 3

SMITH NORTH 3

SMITH SOUTH 1

SMITH NORTH 3

SMITH SOUTH 1

Question 12

What is an advantage of using a hash object in a SAS DATA step?

Options:

A.

The hash object persists after the DATA step has executed

B.

The hash object key values can be multiple numeric and character data values

C.

The hash object automatically sorts the data

D.

The hash object does not require unique keys

Question 13

The following SAS code is submitted:

%macro houses(dsn = houses,sub = RANCH);

data &dsn;

set sasuser.houses;

if style = "¬";

run;

%mend;

%houses(sub = SPLIT)

%houses(dsn = ranch)

%houses(sub = TWOSTORY)

Which one of the following is the value of the automatic macro variable SYSLAST?

Options:

A.

work.ranch

B.

work.houses

C.

WORK.RANCH

D.

WORK.HOUSES

Question 14

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?

Options:

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

Question 15

Given the SAS data set ONE:

ONE

REP 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:

Which SQL procedure clause completes the program and generates the desired output?

Options:

A.

having avg(cost) < select avg(cost) from one);

B.

Having avg(cost)>(select avg(cost) from one);

C.

Where avg(cost)>(select avg(cost) from one);

D.

Where calculated average > (select avg(cost) from one);

Question 16

The following SAS program is submitted:

data temp;

array points{2,3} (10,15,20,25,30,35);

run;

What impact does the ARRAY statement have in the Program Data Vector(PDV)?

Options:

A.

No variable are created in the PDV

B.

The variables named POINTS10, POINTS15, POINTS20, POINTS25, POINTS30,

POINTS35 are created in the PDV

C.

The variables named POINTS1, POINTS2, POINTS3 POINTS4, POINTS5,

POINTS6 are created in the PDV

D.

The variables named POINTS11, POINTS12, POINTS21, POINTS22, POINTS23 are created in the PDV

Question 17

Which one of the following is true regarding the KEEP statement?

Options:

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).

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.

Question 18

The variable attributes of SAS data sets ONE and TWO are shown below:

ONE TWO

# 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;

run;

Which one of the following is the result of the program execution?

Options:

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.

Question 19

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?

Options:

A.

0

B.

Null

C.

6

D.

3

Question 20

Which macro statement would remove the macro variable mv_Info from the symbol table?

Options:

A.

%symercase Mv_Info;

B.

%symdel & Mv_Info;

C.

%symdel Mv_Info;

D.

%mdelete & Mv_Info;

Question 21

Given the SAS date sets CLASS1 and CLASS2

CLASS1 CLASS2

NAME COURSE NAME COURSE

Lauren MATH1 Smith MATH2

Patel MATH1 Farmer MATH2

Chang MATH1 Patel MATH2

Chang MATH3 Hiller MATH2

The following SAS program is submitted:

Proc sql;

Select name from CLASS1

select name from CLASS;

quit;

The following output is desired

NAME

Chang

Chang

Lauren

Which SQL set operator completes the program and generates the desired output?

Options:

A.

UNION ALL

B.

EXCEPT ALL

C.

INTERSECT ALL

D.

OUTER UNION ALL

Question 22

Given the SAS data set ONE:

ONE

NUM VAR

1 A

2 B

3 C

Which SQL procedure program deletes the data set ONE?

Options:

A.

proc sql;

Drop table one;

Quit;

B.

proc sql;

Remove table one;

Quit;

C.

proc sql;

Delete table one;

Quit;

D.

proc sql;

Delete from one;

Quit;

Question 23

Given the data sets shown on the left, the SAS program shown on the right is submitted.

What will be output by the program?

Options:

A.

ERROR: Subquery evaluated to more than one row

B.

Average of Employment 6

C.

Average of Employment 5

D.

Average of employment 7

Question 24

The following SAS program is submitted:

%let value = 9;

%let value2 = 5;

%let newval = %eval(&value / &value2);

Which one of the following is the resulting value of the macro variable NEWVAL?

Options:

A.

1

B.

2

C.

1.8

D.

null

Question 25

Given the data set SASHELP.CLASS:

SASHELP.CLASS

NAME AGE

Mary 15

Philip 16

Robert 12

Ronald 15

The following SAS program is submitted:

%let value = Philip;

proc print data = sashelp.class;

run;

Which WHERE statement successfully completes the program and procedures a report?

Options:

A.

Where upcase(name)=%upcase(&value);

B.

Where upcase(name)="upcase(&value)";

C.

Where upcase(name)=upcase(&value);

D.

Where upcase(name)="%upcase(&value)";

Question 26

The SAS data set WORK.TEMP is indexed on variable Id:

The following SAS program is submitted:

Options:

A.

Stops because the data is not descending order

B.

Generates a report without a problem

C.

Stops because the data is not in ascending order

D.

Generates a report, but only if the index = USE option is turned on

Question 27

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?

Options:

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);

if totrev > 1000;

totcost = sum(fixed,variable);

profit = sum(totrev,otcost);

run;

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;

Demo: 27 questions
Total 184 questions