Variables containing date-, time- and datetime-values are always integers. They look like "dates" when a format is applied to them. So adding a format to the variable containing the maximum will solve the problem.
[pre]proc sql print;
select max(modate) format=datetime.
from sashelp.vtable;
quit;[/pre]
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.