BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Solly7
Pyrite | Level 9

Hi All, i have below data. So what i need to do is to add months after an each renewal. i.e if renewal date is 1-apr-2012, i need to add 12 months until i reach 1-apr-2013( i.e i need to add 1-may-2012, 1-jun-2012 till 1-april 2013).

see my below data

 

Renewal date                     Transaction type

1-april-2012                         R

1-april-2013                         R

1-april-2014                         R

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

Hi @Solly7 ,

 

I suggest to use the intnx() function as follows. This function applies multiples of a given interval to a date and returns the resulting value.

data want;
	set have;
	format Renewal_date2 date9.;
	do i=1 to 12;
		Renewal_date2 = intnx('month',Renewal_date,i-1);
		output;
	end;
	drop i Renewal_date;
	rename Renewal_date2 = Renewal_date;
run;

View solution in original post

2 REPLIES 2
ed_sas_member
Meteorite | Level 14

Hi @Solly7 ,

 

I suggest to use the intnx() function as follows. This function applies multiples of a given interval to a date and returns the resulting value.

data want;
	set have;
	format Renewal_date2 date9.;
	do i=1 to 12;
		Renewal_date2 = intnx('month',Renewal_date,i-1);
		output;
	end;
	drop i Renewal_date;
	rename Renewal_date2 = Renewal_date;
run;
Solly7
Pyrite | Level 9

Hi , your solutions works. thanks a lot