Scenario 3

Directions

This scenario uses the Cert.Staff data set. Write a SAS program to do the following:
  • Create a new temporary SAS data set that uses Cert.Staff and store the results in Work.StaffReports.
  • Select observations where WageCategory is not equal to H.
  • Format the variable DOB as mmddyy10.
  • Create a new variable named Raise whose value is WageRate multiplied by 3%.
  • Determine the grand total of Raise for the entire data set.

Test Your Code

  1. For observation 5, what is the value of DOB?
  2. For observation 15, what is the value of Raise? Round your answer to 2 decimal places.
  3. What is the grand total of Raise for the entire data set?

Objectives Accomplished

  • Use a DATA step to create a SAS data set from an existing SAS data set.
  • Use SAS date and time formats to specify how the values are displayed.
  • Control which observations and variables in a SAS data set are processed and written out to a new data set.
  • Use assignment statements in the DATA step.
  • Use the SUM statement to accumulate subtotals and totals.
Last updated: February 14, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset