sas create a variable that is equal to obs column -
i have file 10 obs. , different parameters. need add data new variable of 'id' each observation- i.e column of numbers 1-10. how can add variable equal obs column? thought doing loop, define empty vat, run on var , each time add '1' previous observation, however, seems kind of complicated. there better way it?
you can use data step automatic variable _n_
. iteration count of data step loop.
data want; set have; id = _n_; run;
Comments
Post a Comment