Suppose your datalines are not quite even, due to extra spaces on some lines. e.g.
01/03/1950 01/03/1960 03Jan1970
05/15/2000 05/15/2002 15May2003
10/10/1998 11/12/2000 25Dec2005
How can you input this?
For example,
does not work.
01/03/1950 01/03/1960 03Jan1970
05/15/2000 05/15/2002 15May2003
10/10/1998 11/12/2000 25Dec2005
How can you input this?
For example,
Code:
data ThreeDates;
input COMPBL(Date1) mmddyy10.
COMPBL(Date2) mmddyy10.
COMPBL(Date3) date9.;
Year12 = yrdif(Date1,Date2,'Actual');
Year23 = round(yrdif(Date2,Date3,'Actual'));
format Date1 Date2 Date3 date9.;
datalines;
01/03/1950 01/03/1960 03Jan1970
05/15/2000 05/15/2002 15May2003
10/10/1998 11/12/2000 25Dec2005
;
title "Listing of Three DATES";
proc print data=ThreeDates noobs;
run;