I am new to SAS and I have the following problem. The database I work with has two dates in two columns and I am supposed to calculate the difference between then in months.
These dates are in format YYMM, eg.: 200603 is March 2006 and 200612 is December 2006. Difference between them should be 9 months.
I am trying to create a new column (called "difference") with the dates difference. I tried the following code:
data TIMES.TEST;
set TIMES.INPUTS;
difference = intck('month',input(fin_period,yymmn6.),input(period,yymmn6.));
run;
It creates a new column named difference (correct) but it is all filled with dots. Nothing is calculated. Have I done something wrong? Is there another way to calculate the difference between two dates when I have such a date format?
Thanks in advance.
I use SAS Studio.