Ensurepass

QUESTION 51

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?

 

A.

0

B.

3

C.

6

D.

null

 

Answer: C

 

 

QUESTION 52

The following SAS program is submitted:

 

%let a=cat;

 

%macro animal(a=frog);

 

%let a=bird;

 

%mend;

 

%animal(a=pig)

 

%put a is &a;

 

What is written to the SAS log?

 

A.

a is pig

B.

a set cat

C.

a is frog

D.

a is bird

 

Answer: B

 

 

QUESTION 53

Given the SAS data sets ONE and TWO:

 

 

 

 

 

clip_image002

 

The following SAS program is submitted:

 

Data combine;

 

Merge one two;

 

By id;

 

Run;

 

Which SQL procedure program procedures the same results?

 

A.

proc sql;

Create table combine as

Select coalesce (one.id, two.id) as id,

Name,salary from one, two where one.id=two.id; Quit;

B.

proc sql;

Create table combine as

Select one.id,

Name, salary from one full join two where one.id=two.id; Quit

C.

proc sql;

Create table combine as

Select one.id,name,salary from one inner join two on one.id=two.id Quit

D.

proc sql;

Create table combine as

Select coalesce (one id, two id) as id,

Name,salary from one full join two on one.id=two.id; Quit;

 

Answer: D

 

 

 

QUESTION 54

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;

 

<insert WHERE statement here>

 

run;

 

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

 

A.

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

B.

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

C.

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

D.

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

 

Answer: D

 

 

QUESTION 55

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 desc

C.

orderby product, revenue desc

D.

order by product, desc revenue

 

Answer: B

 

 

QUESTION 56

The SAS data set ONE contains fifty million observations and contains the variable

 

PRICE, QUANTITY, FIXED and VARIABLE. Which SAS program successfully creates three new variables TOTREV, TOTCOST and PROFIT and requires the least amount of CPU resources to be processed?

 

A.

data two;

Set one;

Where totrev>1000;

Totrev=sum(price*quantity);

Totcost=sum(fixed,variable);

Profit=sum(totrev,-totcost);

Run;

B.

data two;

Set one;

totrev=sum(price*quantity);

where totrev>1000;

totcost=sum(fixed,variable);

profit=sum(totrev,-totcost);

run;

C.

data two;

Set one;

Totrev=sum(price*quantity);

If totrev>1000;

Totcost=sum(fixed,variable);

Profit=sum(totrev,-totcost);

 

 

 

 

Run;

D.

data two;

Set one;

Totrev = sum(price*quantity);

Totcost= sum(fixed,variable);

If totrev>1000;

Profit=sum(totrev,-totcost);

Run;

 

Answer: C

 

 

QUESTION 57

Which one of the following SAS programs displays the descriptor portion of each data set stored in the SASUSER library?

 

A.

proc datasets lib = sasuser.all;

quit;

B.

proc datasets lib = sasuser._all_;

quit;

C.

proc datasets lib = sasuser;

contents data = all;

quit;

D.

proc datasets lib = sasuser;

contents data = _all_;

quit;

 

Answer: D

 

 

QUESTION 58

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?

 

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

 

Answer: D

 

 

QUESTION 59

When reading a SAS data file, what does the NOBS=option on the SET statement represent?

 

A.

A variable that represents the total number of observation in the output data set(s)

B.

A variable that re
presents a flag indicating the end of the file

C.

A variable that represents the total number of observations in the input data set(s)

D.

A variable that represents the current observation number

 

Answer: C

 

 

QUESTION 60

Given the non-indexed SAS data set TEMP:

 

TEMP

 

X Y

 

P 52

 

P 45

 

 

 < /font>

 

A 13

 

A 56

 

R 34

 

R 12

 

R 78

 

The following SAS program is submitted:

 

Proc print data=temp;

 

<insert By statement here?

 

Run;

 

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

 

A.

X;

B.

By X groupd;

C.

By X notsorted;

D.

By descending X;

 

Answer: C

 

Free VCE & PDF File for SAS A00-212 Real Exam

Instant Access to Free VCE Files: CompTIA | VMware | SAP …
Instant Access to Free PDF Files: CompTIA | VMware | SAP …

Comments are closed.