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
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.