9.3... that may be the reason why it is not working. Probably, the curobs= option was introduced in 9.4.
Here is the documentation for the SET statement: https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lestmtsref/p00hxg3x8lwivcn1f0e9axziw57y.htm#n19qtk2v7izsqen1n0am0e5wq268
and some example:
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lestmtsref/p00hxg3x8lwivcn1f0e9axziw57y.htm#p1pp7725k3m4g5n18civhw1vx2s5
Curobs= creates a variable which keeps the number of currently read observation (the real observation number from the data set, so even if WHERE is applied it will return the real obs number).
In case there are no ties in your data on the VALUE variable you can use the following code (since here the _N_ imitates the curobs= quite well):
data have;
input subjid value;
format subjid z3.;
cards;
001 12
002 25
003 30
004 16
005 9
006 26
007 6
;
run;
proc sort data = have out = want;
by value;
run;
data want;
set want nobs = nobs;
compare = (_N_ - 1) - (nobs - _N_);
run;
proc print;
run;
Bart
... View more