The retain statement is used to hold the values of variables accross iterations of the data step. Normally, all variables in the data step are set to missing at the start of each iteration of the data step.
retain x y; retains the values of the variables
y accross data step iterations.
retain; will retain the values of all variables used in
the data step accross iterations of the data step.
As a simple example, look at the following program attempting to compute values of y(n)=2*y(n-1) with y(1)=1.
Since values are set to missing at the start of a data step iteration, the data set dumb will contain one value 1 and the other 99 values of y will be missing.
The following program produces the desired data set.