Things under legendu
**
Things under legendu
data s1; set s; obs_id = n; run;
proc sql; create table s1 as select monotonic() as obs_id, * from s ; run;
The
monotonicfunction runs beforesortandgroup by. So even if it gives distinct observation ID, it guarantees no specific order of observations. It is suggested that you use the data step approach rather than thenonotonicway in SQL if you want the generated observation IDs to preserve some kind of order of observations.