Description
1. Labeling, Formatting, and Conditional Printing
Open SP4R02e05.sas and modify the DATA step, shown below, to complete the exercises. This DATA step generates the Class data table with 20 observations and four variables.
data sp4r.class;
input student $ country $ grade bd @@; datalines;
John Spain 95 12000 Mary Spain 82 12121 Alison France 98 12026
Nadine Spain 77 12222 Josh Italy 61 12095 James France 45 12301
William France 92 12284 Susan Italy 95 12079
Charlie France 88 12234 Alice Italy 89 12014 Robert Italy 92 12025
Emily Spain 87 12148 Arthur Italy 99 12052 Nancy France 70 12238
Kristin France 65 12084 Sara Italy 49 12322 Ashley Spain 96 12299 Aaron France 95 12052 Sean France 87 12254 Phil Italy 86 12036
; run;
a. Use PROC FORMAT to create a format for the grade variable.
Grade GradeFormat
0-59 F
60-69 D
70-79 C
80-89 B
90-100 A
b. Use the DATA step above to read in the Class data set. In the DATA step, label the variable bd as “Birthday” and apply the GradeFormat created in part a. In addition, use the SAS format WORDDATE for the bd variable.
c. Print the Class data table. (Remember to use the LABEL option in the PRINT statement.)
d. Use PROC SQL to print the unique levels of the country variable.
e. Conditionally print the variable student, country, and grade for people with a grade above 79 and from France only.




Reviews
There are no reviews yet.