Variable Transformations |
While Stat Studio provides many standard transformations, the most
powerful feature of the Variable Transformation Wizard is that you can
use the SAS DATA step to create new variables defined by arbitrarily complex
formulas.
You can define custom transformations after selecting
Custom from the Family list in the Variable Transformation
Wizard (Figure 32.21).
Figure 32.21: Selecting a Custom Transformation
The second page of the wizard provides a window for you to enter
DATA step code. The wizard displays the page shown in
Figure 32.22.
Figure 32.22: A Window for Entering DATA Step Code
You can enter any valid DATA step code into this window, with the following conditions:
The data set specified in the SET statement is called the input data set. The data set specified in the DATA statement is called the output data set.
Note that the dialog box shown in Figure 32.22 contains a DATA step template satisfying the first three conditions in the previous list. It is up to you to satisfy the last condition by inserting code before the RUN statement.
The name of the output data set defaults to _VarTransform; the name of the input data set is automatically generated based on the name of your data table. You can accept these default data set names, or you can enter different names.
When you click Finish, the following steps occur:
Each workspace remembers the last custom transformation you entered. If there is an error in your DATA step code, you can again select Analysis Variable Transformation from the main menu and attempt to correct your error. Custom transformations are not remembered between Stat Studio sessions.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.