A Data Science Central Community
Written By Quentin McMullen
In 1986 the Beastie Boys released their classic debut album, License to Ill, and the last track posed a question: “What’s the time?” The Beasties answered with an anthem, “It’s time to get ill.” I think Peter Crawford, SAS programmer extraordinaire, would have answered more simply. What time is it? It’s %now.
%Now generates a timestamp. It’s a simple SAS macro, but despite its simplicity, it has a lot to teach about macro design. In fact, Peter wrote an entire paper about the macro, so I won’t repeat the lessons.
The macro is:
%MACRO now( fmt= DATETIME23.3 ) /DES= 'timestamp' ; %SYSFUNC( DATETIME(), &fmt ) %MEND now ;
It’s a utility macro, and I have it in my autocall library, so that it’s always there when I want it.
I often use it in footnotes. This code snippet:
Read the entire article at Business Intelligence Notes fro SAS Users.
© 2021 TechTarget, Inc.
Powered by
Badges | Report an Issue | Privacy Policy | Terms of Service
Most Popular Content on DSC
To not miss this type of content in the future, subscribe to our newsletter.
Other popular resources
Archives: 2008-2014 | 2015-2016 | 2017-2019 | Book 1 | Book 2 | More
Most popular articles