Malena, I I understand you correctly, you want something like this: data have;
input Id Release_date :mmddyy8. Datenum;
datalines;
1 03/02/11 1245
2 01/01/11 3423
2 01/10/11 5432
run;
proc sort data=have;
by id Release_date;
run;
Data want;
do until(last.id);
set have;
by id;
array months (0:23) $20 month1-month24;
if first.id then
date0=Release_date;
idx=intck('month',Release_date,date0);
if idx>23 then Error 'Date out of range, more than 24 months since first release!';
else call cats(months(idx),Datenum);
end;
drop Release_date date0 idx;
run; A couple of notes: Instead of adding 1 to the array index IDX in every calculation, I zero-based the array (using (0:23) in the array definition). So, in the actual datastep, the month[0] is the month1 variable, etc. I put in a check for array index out of range, just in case. SAS would also throws an errror message if you referenced the array with an index larger than 24, but I think it is better to get a reasonable informative error message. Regards, Søren
... View more