BookmarkSubscribeRSS Feed

Set the time zone for fullstimer SAS system option timestamps

Started Monday by
Modified Monday by
Views 82

The fullstimer SAS system option can be enabled to show additional timing and resource use information about SAS datastep and procedure execution in SAS log output. It specifies whether to write all available system performance statistics and the datetime stamp to the SAS log.

 

The SAS programming run-time has features for dealing with times in different time zones correctly in data, as do the operating systems SAS runs on. See for example Specifying Time Zones in SAS.

 

But a customer recently noticed that the Timestamp in the additional program log output from fullstimer appeared to be in UTC, even though their environment's time zone was otherwise set correctly in each of the several places they looked. That is not necessarily a bad thing; in an organization which operates across multiple time zones everyone sees the same datetime in their SAS log output no matter where it is running. However, the fullstimer Timestamp does not state which time zone it is expressed in.

 

Our trusty SAS customer support engineer Francesco Faccin found a solution. If you add a line to the compute server's startup_commands configuration instance, like the example below, then the timestamp in fullstimer output appears in whichever time zone you specify:

 

export TZ=America/New_York

 

The time zone value ('America/New_York') in the example above can be any of the Time Zone IDs and Time Zone Names described in SAS Help Center.

 

Set fullstimer by including an options fullstimer; statement in your SAS program. Disable it with options nofullstimer;. You can put these statements either side of one or more procedure calls or datasteps to temporarily enable fullstimer just for those statements.

 

We can demonstrate the issue using this SAS code:

 

options fullstimer;
proc options option=(fullstimer timezone);
run;

 

Here's some example output, showing the value of the TIMEZONE SAS system option and some fullstimer output in the SAS program logs in SAS Studio when there is nothing but comments in the compute server startup_options configuration instance:

 

01_DS_Default-fullstimer-output-is-in-UTC-1.png

 

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

The Windows client machine in the screenshot is configured to be in the "(UTC-05:00) Eastern Time (US & Canada)" Windows time zone, and the browser (Chrome) is picking this up and will be passing its time zone to the SAS Viya servers. The host machines for this environment's Kubernetes cluster report that they are in 'America/New_York (EDT, -0400)', which is essentially the same, though it might not look like it.

 

When I took the screenshot at 8:58am EDT, moments after running the code shown, the fullstimer Timestamp was 12:58 PM, which is in UTC/GMT. They don't match. Also, you can see that the TIMEZONE SAS system option is 'GMT-04:00' which is correct for Eastern Time or America/New_York, but is NOT the time zone in which the fullstimer timestamp is expressed.

 

Again, the fullstimer timestamp is not wrong, but it's a little confusing that the output does not make it clear that it is in UTC.

 

If you would rather it was in your local time zone, you can add a line to startup_commands to set the time zone for the fullstimer timestamp too.

 

Here is the compute server's startup_commands configuration instance in SAS Environment Manager, now with the export TZ=[timezone] line added:

 

02_DS_Setting-the-TZ-environment-variable-in-compute-server-startup_commands.png

Setting the TZ environment variable in compute server startup_commands 

 

Save the changes to the startup_commands for the compute server, switch back to SAS Studio, and start a new SAS compute session by choosing Options > Reset SAS Session (or you can refresh the page in the browser, or sign out of SAS Studio and sign in again). Then run the same SAS code in a SAS Program window, and here is the result:

 

03_DS_Fullstimer-output-is-now-in-the-specified-time-zone.png

Fullstimer output is now in the specified time zone 

 

You can see in the SAS program log output that the TIMEZONE SAS System option has not changed, but the time zone for the Timestamp datetime in the fullstimer output has changed. It still doesn't tell you what time zone that timestamp is expressed in, but it is the one you specified.

 

Note that changing the TIMEZONE SAS system option with, for example: options tz='Europe/London'; will certainly change the timezone for most SAS date time processing, but it has no effect on the Timestamp in the fullstimer log output. You can set SAS system options in several other ways too, all with the same result.

 

Well done to Francesco Faccin for finding the solution to this customer question, and for his permission to share it here.

 

See you next time!

 

 

Find more articles from SAS Global Enablement and Learning here.

Contributors
Version history
Last update:
Monday
Updated by:

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags