Previous PageNext Page

First. and Last. Automatic Variables
In the program above there are two new variables - with two level names! Whenever you use a BY statement in a data step, two automatic variables are created for each variable in the data set. FIRST.varname indicates if the current observation is the first one with the current value of the variable (=1 if yes, =0 if no).
LAST.varname indicates if the current observation is the last one with the current value of the variable (=1 if yes, =0 if no).

Example:

Data NumVisit;

Previous PageTable Of ContentsNext Page