Take a look of a point access option of data set. Here is an example.
data x;
input X $1.;
cards;
a
b
c
a
b
a
b
c
a
b
;
data y;
set x nobs=nobs end=end;
cnt=_n_+1;
if cnt<nobs then set x(rename=(x=x2)) point=cnt;
output;
if x='b' and x2 ne 'c' then do;
x='c';
output;
end;
keep x;
run;
proc print;run;