The following might not keep your data points ordered within each group, but will give you row numbers by group. This works in 9.4, don't know about earlier.
PROC SQL;
CREATE TABLE foo AS
SELECT data, group, (MONOTONIC() - MIN(MONOTONIC()) + 1) AS row_n
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!