wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

BAnDS Tournament Round 3

Total questions: 10

Worksheet time: 15mins

Name
Class
Date
1.

How would you modify this SELECT statement to display the Salary column using the EUROX10. format?

proc sql;

select First_Name, Last_Name,

Job_Title, Salary

from Orion.Sales;

quit;

a)

proc sql;

select First_Name, Last_Name,

Job_Title,

Salary ft=eurox10

from Orion.Sales;

quit;

b)

proc sql;

select First_Name, Last_Name, Job_Title,

Salary format = eurox10.

from Orion.Sales;

quit;

c)

proc sql;

select First_Name, Last_Name, Job_Title,

Salary f=eurox10

from Orion.Sales;

quit;

d)

proc sql;

select First_Name, Last_Name, Job_Title,

Salary = eurox10.

from Orion.Sales;

quit;

2.
Which ORDER BY clause orders a report by descending State and descending City?
a)
order by State, City
b)
order by desc State, City
c)
order by State desc, City desc
d)
order by desc State, desc City
3.

The orion.Order_Fact table contains information about orders that were placed by Orion Star Sales staff.

You are asked to create a report that lists the Sales staff whose average quantity of items sold exceeds the company average quantity of items sold.

Which of the following programs will achieve the desired result below?

Employee_ID MeanQuantity

120127 2.20

120128 2.00

120134 1.83

a)

proc sql;

select Employee_ID, Quantity as MeanQuantity format=4.2

from orion.Order_Fact

group by Employee_ID

having MeanQuantity >(select avg(Quantity) from orion.Order_Fact);

quit;

b)

proc sql;

select Employee_ID, avg(Quantity) as MeanQuantity format=4.2

from orion.Order_Fact

group by Employee_ID

having MeanQuantity >(select avg(Quantity) from orion.Order_Fact);

quit;

c)

proc sql;

select Employee_ID, avg(Quantity) as MeanQuantity format=4.2

from orion.Order_Fact

group by Employee_ID

having MeanQuantity <(select avg(Quantity) from orion.Order_Fact);

quit;

d)

proc sql;

select Employee_ID, avg(Quantity) as MeanQuantity format=4.2

from orion.Order_Fact

group by Employee_ID

where MeanQuantity > (select avg(Quantity) from orion.Order_Fact);

quit;

4.

Will the following 3 codes provide you will the same output?

code 1:

%macro calc;

proc means data=orion.order_item &stats;

var &vars;

run;

%mend calc;

%let stats=min max;

%let vars=quantity;

%calc

Code 2:

%macro count(stats, vars);

proc mean data=orion.order_item &stats;

var &vars;

run;

%mend count;

%count(min max,quantity)

code 3:

%macro count(stats = mean , vars = quantity);

proc mean data=orion.order_item &stats;

var &vars;

run;

%mend count;

%count(min max)

a)
Yes
b)
No they are completely different
c)

They will produce the same structure but output different statistics.

d)
No an error is created by one
5.
Which of the following is false?
a)
The SYMPUT routine can be used to create a macro variable during execution of the DATA step or during execution of an SCL program.
b)

In the DATA step, the SYMPUT routine automatically converts to a character value any numeric value that you attempt to assign as the value of a macro variable.

c)
PROC SQL automatically converts to a numeric value any macro variable value that you attempt to compare to a numeric value.
d)
In an SCL program, the SYMPUTN routine can be used to assign a numeric value to a macro variable.
6.
When is the local symbol table deleted from SAS memory?
a)
SAS Initialization
b)
SAS termination
c)
Macro initialization
d)
Macro termination
7.

What is one advantage of Technique 1 in the program below?

options fullstimer;

data order_fact (index=(Order_Date));

set orion.order_fact;

run;

/* Technique 1 */

proc tabulate data=order_fact;

format Order_Date year4.;

class Order_Date;

var Quantity -- CostPrice_Per_Unit;

tables Order_Date*(Quantity Total_Retail_Price CostPrice_Per_Unit),

n mean median pctsum;

run;

/* Technique 2 */

proc tabulate data=order_fact;

format Order_Date year4.;

by Order_Date;

var Quantity -- CostPrice_Per_Unit;

tables Quantity Total_Retail_Price CostPrice_Per_Unit,

n mean median pctsum;

run;

options nofullstimer;

a)
Technique 1 enables the correct use of PCTSUM statistic.
b)
Technique 2 uses much less memory, but the results of the PCTSUM statistic are not what you want.
c)
Technique 2 enables the correct use of PCTSUM statistic.
d)
Technique 1 uses much less memory, but the results of the PCTSUM statistic are not what you want.
8.
Which statement is true concerning the execution phase of the DATA step?
a)
Data is processed in the program data vector (PDV).
b)
An implied OUTPUT occurs at the top of the DATA step.
c)
An implied REINITIALIZE occurs at the bottom of the DATA step.
d)
Columns read from the input table are set to missing when SAS returns to the top of the DATA step.
9.

Which statement is true given the following program?

data work.student;

set sashelp.class;

by Name;

run;

a)
The PDV contains a temporary variable named First.Name.
b)
The output table work.student contains a column named Last.Name.
c)
The DATA step sorts the input table by the column Name.
d)
An error is produced because the BY statement is not permitted in the DATA step.
10.

The code below is submitted in a clean, factory-default SAS sesison.

In which library will the employee dataset be created?

proc sort data = sasuser.employer

out = employee;

by style;

run;

a)

SASHELP

b)

SASUSER

c)

REPORT

d)

WORK