Yesterday, Jiangtang Hu did a frequency analysis of my blog posts and noticed that there are some holidays on which I post to my blog and others on which I do not.
The explanation is simple: I post on Mondays, Wednesdays, and Fridays, provided that SAS Institute (World Headquarters) is not closed. Because I am absent-minded, I wrote a little SAS/IML program that tells me when I am supposed to post. Notice the use of the HOLIDAY function in Base SAS in order to figure out the dates of certain holidays.
proc iml;
date = today(); /** get today's date **/
/** is today M, W, or F? **/
MWF = any( putn(date, "DOWName3.") = {"Mon" "Wed" "Fri"} );
/** Is SAS closed today?**/
/** Find SAS holidays that might occur Mon-Fri **/
year = year(date);
Float = holiday({Labor Memorial NewYear USIndependence}, year);
/** Thanskgiving or day after **/
TDay = holiday("Thanksgiving", year) + (0:1);
/** Christmas or week after **/
WinterBreak = holiday("Christmas", year) + (0:7);
SASHolidays = Float || TDay || WinterBreak;
SASClosed = any(date = SASHolidays);
/** should Rick post to his blog today? **/
if MWF & ^SASClosed then
print "Rick posts a blog today.";
else
print "Rick is working on a post for some other day.";
quit; |
Readers are also welcome to run this program to determine whether a post is scheduled or not.
Kidding. Just kidding.
3 Comments
Here is a graph of the same data using a Heatmap:
https://sites.google.com/site/smatange/ods-graphics/rick-s-blog-history-heatmap
Hi Rick,
The SAS codes reading your blog are available at
http://www.jiangtanghu.com/blog/2011/07/20/retrieve-blogs-using-sas/
Pingback: New 2012 resolutions for my blog - The DO Loop