Scenario 6

Directions

This scenario uses the Excel file heart.xlsx. Write a SAS program to do the following and store the results in the data set Work.Heart.
  • Import the Excel file heart.xlsx.
  • Drop the AgeAtDeath and DeathCause variables from the Work.Heart data set.
  • Include only the observations where Status=Alive in the Work.Heart data set.
  • If the AgeCHDdiag variable has a missing value (.), then do not include the value in Work.Heart.
  • Create a new variable Smoking_Status, set its length to 17 characters, and use the following criteria:
    • If the value of Smoking is between 0 and less than 6, then Smoking_Status is "None (0–5)".
    • If the value of Smoking is between 6 and 15 inclusively, then Smoking_Status is ...

Get SAS Certified Specialist Prep Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.