Introduction

You've learned how to create a SAS data set from raw data that is stored in an external file. You've also learned how to subset observations and how to assign values to variables.

This lesson shows you additional techniques for creating and managing variables. In this lesson, you learn how to create sum variables, assign variable values conditionally, select variables, and assign permanent labels and formats to variables.



Obs ID Name RestHR MaxHR RecHR Tolerance TotalTime Cumulative
Total Seconds
(+5,400)
TestLength
1 2458 Murray, W 72 185 128 D 758 6,158 Normal
2 2539 LaMance, K 75 168 141 D 706 6,864 Short
3 2572 Oberon, M 74 177 138 D 731 7,595 Short
4 2574 Peterson, V 80 164 137 D 849 8,444 Long
5 2584 Takahashi, Y 76 163 135 D 967 9,411 Long


 
Notice:

Setting Up Filerefs for Practices in This Lesson



1 hour



In this lesson, you learn to

  • create variables that accumulate variable values
  • initialize values of sum variables
  • assign values to variables conditionally
  • specify an alternative action when a condition is false
  • specify lengths for variables
  • delete unwanted observations
  • select variables
  • assign permanent labels and formats.

complete the following lessons:

  • .