From your code snippet, it seems like this proc expand
is going to create three variables calpha1, calpha2 and calpha3. cuprod
is one of the options in proc expand
that is going to output the cumulative product. So this is going to find the product of all alpha1, alpha2 and alpha3 within every beg_date group that was sorted like that in by statement. I believe that there should have been a proc sort
before the proc expand
for the use of the by statement.
Regarding the ID statement, it seems like original writer didn't want to use the default time settings of proc expand
. Thus, by specifying date
variable in id statement, the calculations would be based on the points in time given from date
.