
Rick A. answered 03/26/19
Experienced SAS Professional
Add NOBS= to your SET statement. Here is an example using the NOBS= and _N_ variables:
data raa;
x=4; output;
x=5; output;
run;
data raa2;
set raa nobs=tot_obs;
* additional code here;
current_obs=_N_; /* current record number */
total_obs=tot_obs; /* total number of records */
run;