Usage Note 9869: How to print the current date and time in the SAS Output window instead
of the date and time that the SAS session was started
In the SAS Output window, the date and time automatically prints
at the top of each page of output. However, the date and
time printed is the date and time that the current SAS session
was invoked. Instead, you might want print the date and time
that the SAS code is submitted. You can accomplish this by
adding the following code to the top of each SAS program:
options nodate;
data _null_;
call symput ('timenow',put (time(),time.));
call symput ('datenow',put (date(),date9.));
run;
title "The current time is &timenow and the date is &datenow";
The current date and time can be referenced with &timenow and &datenow
variables in any statement, as seen in the TITLE statement above.
OPTION dtreset, has been introduced in SAS 9 that can be used in place
of the above code. See SAS Note #008682 for further details.
Operating System and Release Information
| Product Family | Product | System | Reported Release | Fixed Release* |
| SAS System | Base SAS | Microsoft Windows XP Professional | 8.2 TS2M0 | |
| Microsoft Windows 95/98 | 8.2 TS2M0 | |
| Microsoft Windows NT Workstation | 8.2 TS2M0 | |
| Windows Millennium Edition (Me) | 8.2 TS2M0 | |
| Microsoft Windows 2000 Server | 8.2 TS2M0 | |
| Microsoft Windows 2000 Advanced Server | 8.2 TS2M0 | |
| Microsoft Windows 2000 Datacenter Server | 8.2 TS2M0 | |
| Microsoft Windows 2000 Professional | 8.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | |
| Topic: | Software Components ==> Display Manager
|
| Date Modified: | 2003-05-06 16:53:56 |
| Date Created: | 2003-04-23 17:02:00 |