Try this. You will want to check for end of file etc to avoid warnings, but this works in the simple example I wrote.
Data new;
set old;
counter+1;
chkvar = byvar;
if (condition met) then do pv = counter -10 to counter + 10;
set old point = pv;
if byvar = chkvar then output;
end;
run;
... View more