Sunday, February 9, 2014

Sortable tables in SAS

This is an update of my previous post Make all SAS tables sortable in the output HTML
Previously I manually added the sortable plugin to the SAS output. With the PREHTML statement of PROC TEMPLATE, the sortable HTML template now can be automately saved for the future use.
/* 0 -- Create the sortable HTML template */
proc template;
    define style sortable;
    style body from body /
            <script src=""></script>
            <script src=""></script>
            $(document).ready(function( ) {    
            $(".table").tablesorter({widgets: ["zebra"]});

/* 1 -- Make all the tables sortable */
ods html file = 'tmp.html' style = sortable;
proc reg data=sashelp.class;
    model weight = height age;
proc print data=sashelp.class;
While we explore the data or we like to change the order of SAS’s output tables, we only need to click the table heads, which is quite convenient.

Good math, bad engineering

As a formal statistician and a current engineer, I feel that a successful engineering project may require both the mathematician’s abilit...