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

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -