InterviewSolution
| 1. |
What is the use of Retain in SAS? |
|
Answer» SAS, at the start of each iteration of the data step, reads the data STATEMENT and puts the missing values of variables (assigned either through an INPUT statement or VIA an assignment statement within the data step) into the program data vector (logical areas of memory). RETAIN statements OVERRIDE this default. In other words, a RETAIN statement instructs SAS not to set variables to missing when moving from ONE iteration of the data step to another. The variables are instead retained. Syntax: RETAIN variable1 variable2 ... variablen; There are no limits to the number of variables you can specify. When you do not specify variable names, SAS retains the values of EVERY variable that was created in INPUT or assignment statement by default. |
|