Hello SAS-users.
If I execute the code below I see that 5 records were written to the file TR:
[pre]
5
24
41
46
46
[/pre]
I want only last value (46) to be written and only once.
I thought that eof option in the infile statement can solve this task. But it is not working as i expected.
Can you suggest how to output only the last value with infile datalines at one datastep.
I use SAS 9.1.3
Thanks in advance.
[pre]
FILENAME tr temp;
data vac_used; retain vac_used 0;
infile datalines eof=nn ;
input date1 :ddmmyy10. date2 :ddmmyy10. holidays :5.;
days1=date2-date1+1-holidays;
vac_used=vac_used+days1;
format date1 date2 date9.;
nn: file tr; put vac_used 5.;
datalines;
18.05.2009 22.05.2009 0
24.08.2009 11.09.2009 0
13.10.2010 29.10.2010 0
27.12.2010 31.12.2010 0
;
[/pre]