Click here to see the SAS code.
Click here to see the example.
In this example, I use the datetime() function to get the
date and time, and then use the timepart() function go get
just the time part of that. I then use the mod() function
to divide the time into 86400 (that's the number of seconds
per day), and then I take the remainder (which is the number
of seconds I'm into the current day, past 12 o'clock).
I then create a sas data set containing 1 obsn the number of seconds
past 12-o'clock it is, and the 2nd obsn being the a full clockcycle
(43200 seconds) minus the number of seconds. I plot this data as
a pie chart with 2 slices - the dividing line between the 2 slices
represents the location of an hourhand on an analog clock.
Eureka! -- a sas/graph pie chart clock! :)
I use "goptions cback=yellow;" to make the bright yellow background,
and the "pattern1 v=s c=purple;" to make the purple pie slice.
Each time you re-run the code, it will get the current time.
(the image you're viewing is a snapshot of the actual time when
I last ran my sample).
I also have a version of this pie clock that runs via sas/intrnet,
so that it shows the current time when you view it. This example
is only viewable on the internal sas web, and this version dynamically
updates itself in your browser every few seconds:
SAS/Intrnet Pie Clock
Back to Samples Index