QUESTION 2
The following information is the description of admin.diamonds data set.
Description
Variables
CARAT
Size of diamond (carat weight)
COLOR
Color of diamond (D-almost clear white, Z-colorless, Y-light yellow)
CRTY
Clarity of diamond (FL-flawless, VSI-very slightly imperfect, SI-slightly imperfect, IPF-
imperfect)
CUT
Cut of diamond (EXCELLENT, VERY GOOD, GOOD)
PRICE
Price of diamond (USD)
ORIGIN
Diamond's country of origin (RUSSIA, BOTSWANA, AUSTRALIA, SOUTH AFRICA)
a) Write a PROC SQL query that will produces the same output with given PROC Steps.
SAS approach
data russiadiamond;
set admin.diamonds;
where origin = "RUSSIA";
keep carat color cut price;
run;
proc sort data =
russiadiamond;
by descending price;
run;
SQL approach
b) In PROC Print, generate a report showing the output of russiadiamond data set:
\begin{itemize}
\item Create macro variable named Shape and use it in place of value, EXCELLENT in variable CUT
\item Create macro variable named Min and set to a value 20000.
\item Use macro variables in your PROC Print to filter data only for excellent diamonds and price at least
20000.
\end{itemize}