SAS : How to Display Current Date?
The today() function of SAS programming is basically used to generate current date. The format() function is used to display the format of the date in the specified format.
- In DD-MMM-YYYY format:
Example:
data _null_;dt=today();format dt yymmdd10.;put dt ;run;chevron_rightfilter_noneOutput:
- In DDMMMYYYY format:
Example:
data _null_;dt=today();format dt date9.;put dt ;run;chevron_rightfilter_noneOutput:
20JUL2019
- In MONTH DD, YYYY format:
Example:
data _null_;dt=today();format dt WORDDATE.;put dt ;run;chevron_rightfilter_noneOutput:
JULY 20, 2019
- In WEEKDAY, MONTH DD, YYYY format:
Example:
data _null_;dt=today();format dt date9.;put dt ;run;chevron_rightfilter_noneOutput:
Saturday, July 20, 2019
Recommended Posts:
- SAS | Date Formats and Informats
- 12 Reasons Why You Should Learn Python in 2019
- 5 Most Difficult Programming Languages of the World
- Object Oriented Programming in Ruby | Set-2
- Difference Between Programming, Scripting, and Markup Languages
- Walrus Operator in Python 3.8
- 7 Tips and Tricks to Learn Programming Faster
- Object-Oriented Programming in Ruby | Set 1
- SAS | Delete Empty Rows
- SAS | COALESCE Function with Examples
- SAS | COMPRESS Function with Examples
- Where Statement in SAS Programming
- How to import data into SAS?
- If-Then-Else statement in SAS Programming
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



