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]
Our biggest data and AI event of the year.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.