Help using Base SAS procedures

proc sql max(datetime)

Reply
Occasional Contributor
Posts: 15

proc sql max(datetime)

Hello,

when I want to use max() function over datetime column in proc sql mode, I get some integer result 1.6067E9

Is it able to cast this number to datetime? Or how can i use max() function on datetime column?

Thank you in advance
Super Contributor
Posts: 259

Re: proc sql max(datetime)

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]
Ask a Question
Discussion stats
  • 1 reply
  • 4404 views
  • 0 likes
  • 2 in conversation