Winter Special Flat 65% Limited Time Discount offer - Ends in 0d 00h 00m 00s - Coupon code: suredis

SAS Institute A00-212 SAS Advanced Programming Exam Practice Test

Demo: 27 questions
Total 184 questions

SAS Advanced Programming Questions and Answers

Question 1

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?

Options:

A.

result is true

B.

result is 10 gt 5

C.

result is 1

D.

result is 0

Question 2

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;

Question 3

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

5 RANCH

6 SPLIT

7 SPLIT

The following SAS program is submitted:

proc sql noprint;

select distinct style

into :styles separated by ' '

from sasuser.houses

order by style;

quit;

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

Options:

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

Question 4

Given the SAS data set WORK TRANSACT:

The following output is desired:

Which SQL statement was used?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 5

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 6

The SAS data set ONE contains the variables X,Y,Z and W.

The following SAS program is submitted:

Proc transpose data =one

Out=trans

Name=new;

By x;

var y;

run;

What are the names of all of the columns created by the TRANSPOSE procedure?

Options:

A.

new, X,Y and _COL1_

B.

new, X and COL1 only

C.

new, Y and COL1 only

D.

new, X and Y only

Question 7

Given the following SAS data set ONE:

ONE

JOB LEVEL SALARY

ACC 2 300

SEC 1 100

SEC 2 200

MGR 3 700

ACC 1 .

ACC 3 .

MGR 2 400

The following SAS data set TWO is created:

TWO

JOB LEVEL BONUS

ACC 2 30

MGR 3 70

MGR 2 40

Which one of the following SAS programs creates data set TWO?

Options:

A.

proc sql;

create table two as

select job, level, salary * 0.1 as bonus

from one

where bonus > 20;

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;

Question 8

Which one of the following displays the definition of a stored SQL procedure view in the

SAS log?

Options:

A.

ECHOVIEW option

B.

EXPANDVIEW option

C.

VALIDATE VIEW statement

D.

DESCRIBE VIEW statement

Question 9

At the start of a new SAS session; the following program is submitted:

%macro one;

data _null_;

call symput('proc','measn);

run;

proc &proc data=sashelp.class;

run;

%mend;

%one()

What is the result?

Options:

A.

The marco variable PRCO is stored in the SAS catalog WORK.SASMACR

B.

The program fails to execute because PROC is a reserved word

C.

The macro variable PROC is stored in the local symbol table

D.

The macro variable PROC is stored in the global symbol table

Question 10

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 11

The following SAS program is submitted:

%let dept=prod;

%let prod=merchandise;

The following message is written to the SAS log:

The value is "merchandise"

Which SAS System option writes this message to the SAS log?

Options:

A.

%put the value is "&&&dept";

B.

%put the value is "&&&dept";

C.

%put the value is "&&&dept";

D.

%put the value is %quote (&&&dept);

Question 12

Given the non-indexed SAS data set TEMP:

TEMP

X Y

P 52

P 45

A 13

A 56

R 34

R 12

R 78

The following SAS program is submitted:

Proc print data=temp;

Run;

Which by statement completes the program, create a listing report that is grouped by X and completes without errors?

Options:

A.

X;

B.

By X groupd;

C.

By X notsorted;

D.

By descending X;

Question 13

The following SAS program is submitted:

%macro execute;

proc print data = sasuser.houses;

run;

%end;

%mend;

Which of the following completes the above program so that it executes on Tuesday?

Options:

A.

%if &sysday = Tuesday %then %do;

B.

%if &sysday = 'Tuesday' %then %do;

C.

%if "&sysday" = Tuesday %then %do;

D.

%if '&sysday' = 'Tuesday' %then %do;

Question 14

Which one of the following statements is true regarding a SAS DATA step view?

Options:

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.

Question 15

The following SAS program is submitted:

%let var = chicago, 1;

data a;

var = 'new york, 2';

newvar = %scan(&var,2,%str());

run;

Which one of the following explains why the program fails to execute?

Options:

A.

The %STR() 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.

Question 16

The following SAS program is submitted:

data one;

do i = 1 to 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?

Options:

A.

any integer between 1 and 10

B.

any real number between 0 and 1

C.

any integer between 1 and 2,500,000

D.

any real number between 1 and 2,500,000

Question 17

Which one of the following is an advantage of creating and using a SAS DATA step view?

Options:

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.

Question 18

The following SAS program is submitted:

%macro test(var);

proc print data = sasuser.class;

where age > &var;

run;

%mend;

Which type of parameter is the macro variable VAR?

Options:

A.

default

B.

keyword

C.

positional

D.

command

Question 19

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 20

The following SAS program is submitted:

options yearcutoff = 1950;

%macro y2kopt(date);

%if &date >= 14610 %then %do;

options yearcutoff = 2000;

%end;

%else %do;

options yearcutoff = 1900;

%end;

%mend;

data _null_ ;

date = "01jan2000"d;

call symput("date",left(date));

run;

%y2kopt(&date)

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?

Options:

A.

1900

B.

1920

C.

1950

D.

2000

Question 21

Given the two output sets shown on the left, which program produced the output shown on the right?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 22

Given the following SAS data set ONE:

ONE

LEVEL AGE

1 10

2 20

3 20

2 10

1 10

2 30

3 10

2 20

3 30

1 10

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

quit;

Which one of the following reports is generated?

Options:

A.

LEVEL AGE

2 20

3 20

B.

LEVEL AGE

2 30

3 30

C.

LEVEL MAX

2 20

3 30

D.

LEVEL MAX

2 30

3 30

Question 23

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 24

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 25

Which option forces the use of a specific index from a data set?

Options:

A.

INDEX

B.

IDXNAME

C.

IDXWHERE

D.

INDEX

Question 26

The following SAS program is submitted:

options reuse=YES;

data sasuser RealEstate(compress=CHAR);

set sasuser houses;

run;

What is the effect of the REUSE=YES SAS system option?

Options:

A.

It tracks and recycles free space

B.

It allows a permanently stored SAS data set to be replaced

C.

It allows users to access the same SAS data set concurrently

D.

It allows updates in place

Question 27

The following SAS program is submitted:

proc sql;

select *

from dictionary.tables;

quit;

Which one of the following is reported?

Options:

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

Demo: 27 questions
Total 184 questions