Scenario 2

Directions

This scenario uses the Cert.Stress data set. Write a SAS program to do the following:
  • Create a new temporary SAS data set that uses Cert.Stress and store the results in Work.Stress1.
  • Remove observations with RestHR values that are greater than or equal to 70.
  • Create a new variable called TotalTime. The value of TotalTime is the value of TimeMin multiplied by 60, plus the value of TimeSec.
  • Remove TotalTime values that are less than 600.

Test Your Code

  1. How many observations are in Work.Stress1?
  2. What is the value of TotalTime for observation 5 in Work.Stress1?

Objectives Accomplished

  • Use a DATA step to create a SAS data set from an existing SAS data set.
  • 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 IF/THEN-ELSE statements to process data conditionally.
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