NEW
Font size
WorksheetsBAnDS Tournament Round 3
Total questions: 10
Worksheet time: 15mins
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;
proc sql;
select First_Name, Last_Name,
Job_Title,
Salary ft=eurox10
from Orion.Sales;
quit;
proc sql;
select First_Name, Last_Name, Job_Title,
Salary format = eurox10.
from Orion.Sales;
quit;
proc sql;
select First_Name, Last_Name, Job_Title,
Salary f=eurox10
from Orion.Sales;
quit;
proc sql;
select First_Name, Last_Name, Job_Title,
Salary = eurox10.
from Orion.Sales;
quit;
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
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;
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;
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;
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;
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)
They will produce the same structure but output different statistics.
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.
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;
Which statement is true given the following program?
data work.student;
set sashelp.class;
by Name;
run;
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;
SASHELP
SASUSER
REPORT
WORK
