DATA Step, Macro, Functions and more

if blank then add system date

Reply
Occasional Contributor
Posts: 14

if blank then add system date

[ Edited ]

wherever there is blank date i wnat to  put today's system date

Super User
Posts: 6,948

Re: if balnk then add system date

if datefield = . then datefield = date();
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 14

Re: if balnk then add system date

but It gives me sas date

Super User
Posts: 6,948

Re: if balnk then add system date

Of course, as intended. Dates are dates, and the SAS DATE function returns the current date as supplied by the operating system.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 17,868

Re: if blank then add system date

Since you say blank I'm going to assume you have a character value? Or is it numeric?

 

And if character what format is applied, ie how does it look 01Jan2016 or 01/01/2016?

Ask a Question
Discussion stats
  • 4 replies
  • 339 views
  • 0 likes
  • 3 in conversation