DATA Step, Macro, Functions and more

Today() Function

Accepted Solution Solved
Reply
Regular Contributor
Posts: 212
Accepted Solution

Today() Function

I'm trying to write the current datetime to my log when my program ends. I'm obviously not getting my expected result. Any ideas where I'm going wrong here?

 

data _null_;
   dt_stamp = today();
   PUT 'Progam Stopped: ' dt_stamp datetime20.;
run;

Progam Stopped:   01JAN1960:05:45:32

Accepted Solutions
Solution
‎10-05-2016 02:36 PM
Super User
Posts: 5,516

Re: Today() Function

Posted in reply to buechler66

Back to the future!

 

The TODAY() function doesn't return a date-time value.  It just returns a date.  You could switch to DATETIME() instead.

View solution in original post


All Replies
Solution
‎10-05-2016 02:36 PM
Super User
Posts: 5,516

Re: Today() Function

Posted in reply to buechler66

Back to the future!

 

The TODAY() function doesn't return a date-time value.  It just returns a date.  You could switch to DATETIME() instead.

Regular Contributor
Posts: 212

Re: Today() Function

Posted in reply to Astounding

That worked for me.  Thanks very much.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 414 views
  • 1 like
  • 2 in conversation