Scenario 1

Directions

This scenario uses the Cert.Patients and Cert.Measure data sets. Write a SAS program to do the following:
  • Sort Cert.Patients and Cert.Measure by ID.
  • Use the match-merging technique to combine Cert.Patients and Cert.Measure to create a new temporary data set named Work.Merge.
  • Select observations for the patients under the age of 50.
  • Sort the new data set, Work.Merge, by Age in descending order.
  • Save the sorted data set as Work.Sortpatients.

Test Your Code

  1. What the value of the Age variable for observation 6 in Work.Sortpatients?
  2. What is the value of the Weight variable for observation 3 in Work.Sortpatients?

Objectives Accomplished

  • Combine SAS data sets using match-merging.
  • Use a DATA step to create a SAS data set from an existing SAS data set.
  • Use the IF/THEN-ELSE statements to process data conditionally.
  • Use the SORT procedure to re-order observations in place or write them out to a new data set.
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