Académique Documents
Professionnel Documents
Culture Documents
SEMESTER 2, 2016
Lab exercise Week 13: SOLUTIONS
A data set named revenue contains the product code, the price, the
quantity sold, the product name, the customer name and the revenue
generated from each sale. Revenue is calculated as Price*Quantity.
The Name variable in web_converted refers to the product name and the
Name variable in web_orders2 refers to the customer name. Give each
variable an appropriate name in the revenue data set.
A data set named notsold contains the product code, price, and product
name for each product that was not sold.
A data set named invalidcode contains the product code, quantity, and
customer name for each observation in the web_orders2 data set that
does not have a corresponding product code in the web_products2 data
set.
c. Print the three data sets with appropriate titles. The data sets should contain
39, 7,and 4 observations, respectively.
Price
53.26
53.26
107.74
107.74
107.74
40.96
Product_Name
Knife
Knife
Big Guy
Big Guy
Big Guy
Big Guy
Men's
Men's
Men's
Men's
Quantity
16
19
13
13
10
13
Customer
Revenue
Carglar Aydemir
Sanelisiwe Collier
Candy Kinsey
Cynthia Martinez
Rolf Robak
Ahmet Canko
852.16
1011.94
1400.62
1400.62
1077.40
532.48
Listing of notsold.
Revenue Not Orders
Product_ID
120400304333
120400308849
120400311211
120400317183
120400329978
120400330339
120400330967
Price
114.36
12.23
69.16
164.82
114.47
31.74
38.73
Product_Name
Smasher Super Rq Ti 350 Tennis Racket
Wood Box for 6 Balls
Tipee Summer Sleeping Bag
Smasher Rd Ti 70 Tennis Racket
Tipee Twin Blue/Orange
Small Belt Bag, Black
Duwall Pants
Listing of invalidcode.
Invalid Orders
Product_ID
Quantity
120400311465
120400312556
120400315078
120400326278
13
7
23
10
Customer
Thomas Leitmann
Robyn Klem
Tonie Asmussen
Theunis Brazier
Write a POC SQL inner join to combine information from these tables.
Quantity
Order ID
Product ID Product Name
Ordered
Write a program to create a macro variable, minSal, and set its value to
represent a minimum salary of $60,000.
Use the orion.employee_payroll data set and the PRINT procedure to
generate the report below.
- Format birth_date, employee_date, and employee_term_date with
the DATE9. Format.
- Add an appropriate title and verify your results
Obs
Employee_ID
1
2
3
99
120101
120102
120103
120259
Employee_
Gender
Salary
Birth_
Date
M
M
M
M
163040
108255
87975
433800
6074
3510
-3996
1485
Employee_
Hire_Date
15887
10744
5114
10836
Employee_
Term_Date
Marital_
Status
.
.
.
.
%let minSal=60000;
title "Employee Earning at Least $&minSal";
proc print data=orion.employee_payroll;
where salary>=&minSal;
run;
S
O
M
M
Dependents
0
2
1
1
Obs
Employee_ID
1
2
99
100
101
102
124
417
418
120101
120102
120259
120260
120261
120262
120659
121141
121142
Employee_
Gender
Salary
Birth_
Date
M
M
M
F
M
M
M
M
M
163040
108255
433800
207885
243190
268455
161290
194885
156065
6074
3510
1485
1797
3339
3581
-3821
-5674
3332
Employee_
Hire_Date
Employee_
Term_Date
15887
10744
10836
9071
10074
10471
5114
5114
12174
.
.
.
.
.
.
.
.
.
Marital_
Status
S
O
M
M
O
M
M
S
M
%let minSal=100000;
title "Employee Earning at Least $&minSal";
proc print data=orion.employee_payroll;
where salary>=&minSal;
run;
Dependents
0
2
1
2
1
2
3
0
2