ABSTRACT

Creating variables in the DATA step is an essential task in DATA step programming. If the assigned values to the newly created variable are the same across all the observations, the variable can be created by using the assignment statement. However, in most applications, assigned values are often different across the records, and these values are generated depending upon a certain condition. In this situation, a common approach to creating a variable conditionally is to use the IF-THEN/ELSE statement.