08-03-2007 01:50 PM
05-16-2014 05:37 AM
I have put some code below which should answer your query. If anything is not clear let me know.
All the best.
* Example dataset based on the information you gave;
DO base= 1 TO 10;
* Create new variable 'new' based on variable 'base', _N_ is the automatic macro variable which hold the value of observation number that is being processed from
input dataset (original), It can be used to count observation number as well;
new = (base*(_N_+1)) * (base*(_N_));