Sentry Page Protection
Coding Exercise (Answer)
Exercise 1
Answer:
Proc Format;
Value Ques
1= "Strongly Disagree"
2= "Somewhat Disagree"
3= "Neither Agree nor Disagree"
4= "Somewhat Agree"
5= "Strongly Agree";
Run;
Data Survey2;
Set Survey;
Format Q1 Q2 Q3 Ques.;
Label
Q1 = "Customer service representatives (CSRs) are well supervised."
Q2 = "Customer service representatives (CSRs) adhere to professional standards of conduct."
Q3 = "Customer service representatives (CSRs) act in my best interest.";
Run;
Exercise 2
Exercise 1
Answer:
Proc Format;
Value Ques
1= "Strongly Disagree"
2= "Somewhat Disagree"
3= "Neither Agree nor Disagree"
4= "Somewhat Agree"
5= "Strongly Agree";
Run;
Data Survey2;
Set Survey;
Format Q1 Q2 Q3 Ques.;
Label
Q1 = "Customer service representatives (CSRs) are well supervised."
Q2 = "Customer service representatives (CSRs) adhere to professional standards of conduct."
Q3 = "Customer service representatives (CSRs) act in my best interest.";
Run;
Exercise 2
Answer:
Data Listing2;
Set Listing;
Format DateList2 Date9. NumMth2 Best. Price2 dollar8.;
DateList2 = input(DateList, date9.);
NumMth2 = input(NumMth, best.);
Price2 = input(Price, dollar8.);
Drop DateList NumMth Price;
Run;
Exercise 3
Answer:
proc contents data=sashelp.jac;
run;
There are 5 variables and 7923 observations in the data set.
Exercise 4
Answer:
data temp2;
set temp;
format fah 4.1;
Fah = temp * 9/5 + 32;
run;
Data Listing2;
Set Listing;
Format DateList2 Date9. NumMth2 Best. Price2 dollar8.;
DateList2 = input(DateList, date9.);
NumMth2 = input(NumMth, best.);
Price2 = input(Price, dollar8.);
Drop DateList NumMth Price;
Run;
Exercise 3
Answer:
proc contents data=sashelp.jac;
run;
There are 5 variables and 7923 observations in the data set.
Exercise 4
Answer:
data temp2;
set temp;
format fah 4.1;
Fah = temp * 9/5 + 32;
run;