sas stored processes for creating great visualisations

138
SAS Stored Processes and Developing Web Applications Phil Mason Independent SAS Consultant SAS University Edition includes the SAS 9.4 products Base SAS®, SAS/STAT®, SAS/IML®, SAS/ACCESS® Interface to PC Files, and SAS® Studio. Runs in a Virtual Machine on PC, Mac or Linux. And you can download it for FREE!!! Did you know? http://www.sas.com/en_us/software/university-edition.html

Upload: phil-mason

Post on 13-Apr-2017

1.052 views

Category:

Data & Analytics


3 download

TRANSCRIPT

Page 1: Sas stored processes for creating great visualisations

SAS Stored Processes and Developing Web ApplicationsPhil Mason Independent SAS Consultant

SAS University Edition includes the SAS 9.4 products Base SAS®, SAS/STAT®, SAS/IML®, SAS/ACCESS® Interface to PC Files, and SAS® Studio. Runs in a Virtual Machine on PC, Mac or Linux. And you can download it for FREE!!!

Did you know?

http://www.sas.com/en_us/software/university-edition.html

Page 2: Sas stored processes for creating great visualisations

Contents▪ Creating a Simple Web App using Enterprise Guide ▪ Make a report ▪ Turn it into a Stored Process ▪ Use Stored Process Web App ▪ Make a better Web App ▪ Add some HTML ▪ Add Java Script ▪ Make use of JavaScript libraries ▪ Identify a good visualisation ▪ Integrate with SAS Stored Processes

Page 3: Sas stored processes for creating great visualisations

Make Report 1 of 6

Page 4: Sas stored processes for creating great visualisations

Make a report▪ Use Enterprise Guide ▪ Build a query

Page 5: Sas stored processes for creating great visualisations

Query Builder

Page 6: Sas stored processes for creating great visualisations

Query builder

Page 7: Sas stored processes for creating great visualisations

Now you have a query

Page 8: Sas stored processes for creating great visualisations

Make Stored Process

2 of 6

Page 9: Sas stored processes for creating great visualisations

Make a Stored Process

Page 10: Sas stored processes for creating great visualisations

Name it

Page 11: Sas stored processes for creating great visualisations

View code

Page 12: Sas stored processes for creating great visualisations

Pick Repository

Page 13: Sas stored processes for creating great visualisations

Librefs

Page 14: Sas stored processes for creating great visualisations

Prompts

Page 15: Sas stored processes for creating great visualisations

Data Sources & Targets

Page 16: Sas stored processes for creating great visualisations

Review

Page 17: Sas stored processes for creating great visualisations

Edit Stored Process

Page 18: Sas stored processes for creating great visualisations

Stored Process▪ Composed of: ▪ A metadata component ▪ A code component ▪ Alternative way to create a Stored Process ▪ Create the code with an editor ▪ In Management Console create the metadata/code

Page 19: Sas stored processes for creating great visualisations

Let’s take a quick look at Management Console

Page 20: Sas stored processes for creating great visualisations

Create using Management Console

Page 21: Sas stored processes for creating great visualisations

Name it

Page 22: Sas stored processes for creating great visualisations

Execution settings▪ Select server to run it on ▪ Specify we want to stream output and that we can

produce a package ▪ Keep code in metadata

Page 23: Sas stored processes for creating great visualisations

Edit Source Code

Page 24: Sas stored processes for creating great visualisations

Define parameters

Page 25: Sas stored processes for creating great visualisations

Run it via Enterprise Guide

Page 26: Sas stored processes for creating great visualisations

Edit a Stored Process with Management Console

▪ Find the one you want and double click it

Page 27: Sas stored processes for creating great visualisations

Management Console

Name & Location

Page 28: Sas stored processes for creating great visualisations

Management Console

Page 29: Sas stored processes for creating great visualisations

Management Console

Page 30: Sas stored processes for creating great visualisations

Management Console

Page 31: Sas stored processes for creating great visualisations

Management Console

Page 32: Sas stored processes for creating great visualisations

Management Console

Page 33: Sas stored processes for creating great visualisations

Management Console

Page 34: Sas stored processes for creating great visualisations

Stored Process Web Application▪ Comes with Integration Technologies ▪ Needs some configuring, including a Web Application

Server ▪ Allows running a stored process ▪ From a web browser ▪ From any other place where you can use a URL ▪ e.g. An application such as EXCEL, MS Word

▪ Parameters passed on URL appear as macro variables to Stored Process ▪ This is a great feature!

Page 35: Sas stored processes for creating great visualisations

Stored process web application

Page 36: Sas stored processes for creating great visualisations

Get a menu down left

Page 37: Sas stored processes for creating great visualisations

Run stored process from web app

Page 38: Sas stored processes for creating great visualisations

Run stored process from browser

Page 39: Sas stored processes for creating great visualisations

Run stored process from excel

Page 40: Sas stored processes for creating great visualisations

Open one to run it

Page 41: Sas stored processes for creating great visualisations

Results of run appear in EXCEL

Page 42: Sas stored processes for creating great visualisations

Add a Graph to Stored Process

Page 43: Sas stored processes for creating great visualisations

Result in web browser

Page 44: Sas stored processes for creating great visualisations

Add parameter

Page 45: Sas stored processes for creating great visualisations

Add prompt for macro parameter added

Page 46: Sas stored processes for creating great visualisations

Stored Process using parameter via prompt

Page 47: Sas stored processes for creating great visualisations

URL showing parameter passedhttp://my.server/SASStoredProcess/do? _program=/Shared Data/SASTesting/ Test3&product_line=Children

http://my.server/SASStoredProcess/do? _program=%2FShared+Data%2FSASTesting%2F Test3&product_line=Children

Encoded

Page 48: Sas stored processes for creating great visualisations

Enhance with HTML &

JavaScript 3 of 6

Page 49: Sas stored processes for creating great visualisations

Make a better Web App▪ Use some HTML ▪ Gives us some more control ▪ Use some JavaScript ▪ Great for adding more interactivity ▪ Allows programming to control User Interface

Page 50: Sas stored processes for creating great visualisations

Simple HTML <html> <body> <h1>Pick a report to run</h1> <a href="http://my.server/SASStoredProcess/do? _program=%2FShared+Data%2FSASTesting%2FTest3 &product_line=Children"> Children</a><p> <a href="http://my.server/SASStoredProcess/do? _program=%2FShared+Data%2FSASTesting%2FTest3 &product_line=Clothes+%26+Shoes">Clothes & Shoes</a><p> <a href="http://my.server/SASStoredProcess/do? _program=%2FShared+Data%2FSASTesting%2FTest3 &product_line=Outdoors">Outdoors</a><p> <a href="http://my.server/SASStoredProcess/do?_program=%2FShared+Data%2FSASTesting%2FTest3 &product_line=Sports">Sports</a><p> </body> </html>

Page 51: Sas stored processes for creating great visualisations

HTML Menu

Page 52: Sas stored processes for creating great visualisations

Report shown in browser

Page 53: Sas stored processes for creating great visualisations

Using a form to run a Stored Process▪ HTML form is great for making User Interfaces ▪ Form tag ▪ Make the first part of URL ▪ Input tag, using different type settings ▪ Text – fields for text ▪ Password – passwords where text is hidden ▪ Radio – radio buttons ▪ Checkbox – check boxes ▪ Submit – submit buttons to execute URL using parts of form

Page 54: Sas stored processes for creating great visualisations

HTML using Form

Page 55: Sas stored processes for creating great visualisations

What’s displayed

Page 56: Sas stored processes for creating great visualisations

Writing directly from Stored Process to browser

▪ _webout ▪ Reserved fileref for writing from Stored Process to browser ▪ %stpbegin macro sends output from procs to _webout ▪ %stpend stops output going to _webout ▪ Can write from a datastep to _webout

▪ Best to turn automatic Stored Process macros off

Page 57: Sas stored processes for creating great visualisations

New stored process to write HTML

Page 58: Sas stored processes for creating great visualisations

Stored process produces this

Page 59: Sas stored processes for creating great visualisations

Add iFrame to keep output on same page

Page 60: Sas stored processes for creating great visualisations

Now menu & output on same page

Page 61: Sas stored processes for creating great visualisations

Useful optional parameters for Stored Processes

▪ _odsdest – lets us choose an ODS destination for type of output produced ▪ Switch between HTML, RTF, PDF, EXCEL, etc. ▪ _odsstyle – choose an ODS style ▪ _debug – can produce the SAS log, execution times, etc. ▪ _debug=log,time ▪ _debug=2179 … this is my favourite

Page 62: Sas stored processes for creating great visualisations

Define a dropdown menu for type of output

Page 63: Sas stored processes for creating great visualisations

Output type is added to menu

Page 64: Sas stored processes for creating great visualisations

HTML Headers▪ Set headers in HTML from stored process ▪ Indicates what browser should do ▪ RTF

▪ EXCEL

rc = stpsrv_header("Content-type", "application/msword") ;rc = stpsrv_header('Content-disposition','attachment; filename=test.rtf');

rc = stpsrv_header("Content-type", "application/pdf") ; rc = stpsrv_header('Content-disposition','attachment; filename=test.pdf');

Page 65: Sas stored processes for creating great visualisations

RTF output

Page 66: Sas stored processes for creating great visualisations

Define dropdown for ODS style

Page 67: Sas stored processes for creating great visualisations

Here is what 2 ODS style selections produce

Page 68: Sas stored processes for creating great visualisations

Add some checkboxes

Page 69: Sas stored processes for creating great visualisations

After report we get the log

Page 70: Sas stored processes for creating great visualisations

After log we get time

Page 71: Sas stored processes for creating great visualisations

Parts of URL for stored process callhttp://khv-sas-iis.cfsi.local/SASStoredProcess/do? _program=%2FShared+Data%2FSASTesting%2FTest3 &product_line=Children &_odsdest=html &_odsstyle=meadow &_debug=log &_debug=time

Page 72: Sas stored processes for creating great visualisations

Useful automatic macro variables

Page 73: Sas stored processes for creating great visualisations

Use automatic macro variables▪ Construct a URL using: ▪ &_srvname ▪ &_srvport ▪ &_url

Page 74: Sas stored processes for creating great visualisations

What’s good about this technique▪ Easily make SAS code run from a web browser ▪ Generate HTML, Excel, PDF or RTF easily. ▪ Easily add parameters making it much more flexible ▪ Build up a multiple page Web Application

Page 75: Sas stored processes for creating great visualisations

What’s not so good▪ Tables and graphs don’t look as good as they could ▪ Can improve their look with some more work within SAS ▪ Tables lack some functionality ▪ Cant sort columns ▪ Slow using lots of data ▪ Table headers are not fixed, so they will scroll away if tables are long ▪ Only some basic widgets available for building a UI ▪ Only basic use of mouse for selecting

Page 76: Sas stored processes for creating great visualisations

Adding some JavaScript for interactivity▪ onLoad – execute when page finishes loading ▪ onUnload – execute when page closes ▪ onKeyPress – execute when a key is pressed ▪ onKeyUp – execute when a key is released ▪ onMouseOver – execute when mouse is over something ▪ onMouseOut - … when mouse moves away ▪ onMouseDown … when left button is pressed ▪ onMouseUp … when left button is released ▪ onClick … when left button is clicked ▪ onDblClick … when left button is double clicked

Page 77: Sas stored processes for creating great visualisations

JavaScript Demo

▪ Lets see some of those things…

▪ Note: not all browsers support all JavaScript (in the same way) ▪ Try things out in all the browsers you might use

Page 78: Sas stored processes for creating great visualisations

<html>

<head> <script type='text/javascript'> var popwin = null;

function open_popup() { if (popwin == null) popwin = window.open( 'http://www.google.com', '', 'top=150, left=350, width=250, height=50, status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=0, scrollbars=0' ); }

function close_popup() { if (popwin != null) { popwin.close(); popwin = null; } }

function checkKey() { var key = String.fromCharCode( window.event.keyCode); if (key == 'X') { alert( "You pressed the X key" ); } } </script>

Some added JavaScript for extra functionality

Page 79: Sas stored processes for creating great visualisations

JavaScript providing more interactivity</head>

<body onload='alert("finished loading");' onunload='alert("finished unloading");' onkeypress='window.status="key pressed is: " + String.fromCharCode(window.event.keyCode) ;' onkeyup='window.status="key up"; checkKey() ;'> Pop-up a window with information by moving over <a href='#' onmouseover='open_popup(); window.status="Hovering over the link" ; return true ;' onmouseout='close_popup(); window.status=" " ; return true ;'>here</a>. <p>Pop-up a window with information by holding mouse button down <a href='#' onmousedown='open_popup();' onmouseup='close_popup();'>here</a>. <p><a href='#' ondblclick='open_popup();'>Double click to open</a>, <a href='#' onclick='close_popup();'>single click to close here</a>. <p><a href='#' style='font-size="x-large"' onmousemove='open_popup();'>Move mouse over this to open</a>, <a style='font-size="x-large"' href='#' onmousemove='close_popup();'>move over this to close</a>. <p>Press <b>X</b> to make an alert window pop up. <p>Hold down a key to see what it is in the status bar. </body>

</Html>

Page 80: Sas stored processes for creating great visualisations

Stored Process generates HTMLSome excerpts…

<form method="get" action="http://khv-sas-iis2.cfsi.local/SASStoredProcess/do?" target="content"> <select name="_program"> <option value="/Shared Data/SASTesting/cabotCollectionsDashboard">Month to Date</option> <option value="/Shared Data/SASTesting/ccDashDaily">Daily</option> <option value="/Shared Data/SASTesting/ccDashYTD">Year to Date</option> </select>

<input type="checkbox" name="_debug" value="log">Show log<nbsp><nbsp><nbsp> <input type="checkbox" name="_debug" value="time">Show time taken<nbsp> <input type="checkbox" name="inline" value="1">Inline?<nbsp> <input type="submit" value="Run"><br>

Page 81: Sas stored processes for creating great visualisations

More excerpts of HTML

organisationName <select name="organisationName" onchange="this.form.submit();"> <option value="Cabot Debt Purchase " selected>Cabot Debt Purchase </option> <option value="Cabot Stratford Serviced ">Cabot Stratford Serviced </option> </select>

</form> <iframe name="content" height="85%" width="100%"> </iframe> </body> </html>

Page 82: Sas stored processes for creating great visualisations

Use JavaScript Libraries

4 of 6

Page 83: Sas stored processes for creating great visualisations

A few good JavaScript libraries▪ jQuery ▪ Write less, do more ▪ HandsOnTable or EasyUI ▪ Excel-like spreadsheet for Apps ▪ HighCharts ▪ Create interactive web charts easily ▪ D3 ▪ Data Driven Documents

Page 84: Sas stored processes for creating great visualisations

Manipulating your web page▪ jQuery makes it easy to select parts of your page and

attach functionality

$(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); });

$(document).ready(function(){ $("button").click(function(){ $("#div1").fadeIn(); $("#div2").fadeIn("slow"); $("#div3").fadeIn(3000); }); });

<script> $(document).ready(function(){ $("button").click(function(){ $("#div1").load("demo_test.txt"); }); }); </script>

<div id=“div1"> <h2>Let jQuery AJAX Change This Text</h2> </div>

<button>Get External Content</button>

Page 85: Sas stored processes for creating great visualisations

Making a better table in web browsers

Page 86: Sas stored processes for creating great visualisations

Making interactive charts

Page 87: Sas stored processes for creating great visualisations

Creating Data Driven Documents

Page 88: Sas stored processes for creating great visualisations

Hosted Libraries▪ You can download JavaScript libraries and keep on your site ▪ Or you can use a Hosted Library, such as Google’s ▪ read about it here https://developers.google.com/speed/

libraries/ <script src=“https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js”></script> ▪ Some host their own library <script src=“http://d3js.org/d3.v3.min.js"></script> <script src="http://code.highcharts.com/highcharts.js"> </script>

Page 89: Sas stored processes for creating great visualisations

How to use SAS with JavaScript objects▪ HTML 5 structures your page ▪ CSS 3 controls the look and feel ▪ JavaScript handles the interactivity ▪ Data typically either hard-coded or provided in JSON,

CSV, TSV, …

▪ SAS Stored Processes ▪ Provide the data in CSV or JSON format ▪ using data steps or PROC JSON ▪ Create and customise the HTML, CSS & JavaScript ▪ Using data steps or PROC STREAM

Page 90: Sas stored processes for creating great visualisations

Use JSON with Stored

Processes 5 of 6

Page 91: Sas stored processes for creating great visualisations

What is JSON and why use it?

▪ Key-Value pairs ▪ Man and Machine readable ▪ Nested if necessary ▪ Used by many JavaScript objects ▪ Is a subset of JavaScript Object Notation, which is how

objects in JavaScript are built ▪ Sometimes XML or CSV can be used ▪ Very flexible ▪ can represent complex nested hierarchies of data

Page 92: Sas stored processes for creating great visualisations

Lovely diagrams from Wikipedia

Page 93: Sas stored processes for creating great visualisations

Example{ "name": "Phil Mason", "home": { "town": "Wallingford", "phone": 1491824891, "current home": true, "ages": [ 51, 46, 18, 16, 13 ] } }

Page 94: Sas stored processes for creating great visualisations

Data Step to produce JSON▪ Can run from a stored process ▪ Write to _webout to stream to browser ▪ Can define macros, to make it flexible and easy to repeat ▪ Can handle very complex & nested JSON

Page 95: Sas stored processes for creating great visualisations

Example data step making JSONdata _null_ ; set sashelp.class end=_end ; if _n_=1 then put '[' ; put '{' ; put '"Name":"' name +(-1) '",' ; put '"Sex":"' sex +(-1) '",' ; put '"Age":"' age +(-1) '",' ; put '"Height":"' height +(-1) '",' ; put '"Weight":"' weight +(-1) '"' ; put '}' ; if not _end then put ',' ; else put ']' ; run ;

Page 96: Sas stored processes for creating great visualisations

[ { "Name":"Alfred", "Sex":"M", "Age":"14", "Height":"69", "Weight":"112.5" } , { "Name":"Alice", "Sex":"F", "Age":"13", "Height":"56.5", "Weight":"84"

Page 97: Sas stored processes for creating great visualisations

PROC JSON▪ SAS 9.4 ▪ Easily produces JSON from SAS datasets ▪ Can produce more complex JSON as well as simple

JSON ▪ Can use macros to write PROC JSON, making it very

flexible

Page 98: Sas stored processes for creating great visualisations

PROC JSON▪ Minimum code needed ▪ Produces default output

{ "SASJSONExport": "1.0", "SASTableData+CLASS": [ { "Name": "Alfred", "Sex": "M", "Age": 14, "Height": 69, "Weight": 112.5 }, { "Name": "Alice", "Sex": " F", "Age": 13, "Height": 56.5, "Weight": 84 },

proc json out=temp ; export sashelp.class ;

run ;

Page 99: Sas stored processes for creating great visualisations

Better PROC JSON code▪ Pretty - lays out the JSON clearly ▪ noSAStags - leaves out SAS metadata from the JSON

proc json out='/tmp/class.json' pretty nosastags ; export sashelp.class ; run ;

[ { "Name": "Alfred", "Sex": "M", "Age": 14, "Height": 69, "Weight": 112.5 },

Produces this output

Page 100: Sas stored processes for creating great visualisations

JavaScript libraries with

SAS 6 of 6

Page 101: Sas stored processes for creating great visualisations

PROC STREAM▪ Processes text and expands macros within it ▪ Text is sent to an external file ▪ Can execute SAS code while processing the input stream ▪ using %sysfunc(dosub(fileref)) ▪ Can include text into stream for processing ▪ using %include filleref ▪ Files can be read into stream, but macros not processed ▪ using &streamdelim readfile filref ▪ Newlines can be forced in output ▪ using &streamdelim newline

Page 102: Sas stored processes for creating great visualisations

Simple example%macro cols(n) ; %do i=1 %to &n ; <td>&i</td> %end ; %mend cols ; filename out '/folders/myfolders/test.html' ; proc stream outfile=out ; BEGIN <table> <tr>%cols(4)</tr> </table> ;;;;

<table><tr><td>1</td> <td>2</td> <td>3</td> <td>4</td></tr></table>

Page 103: Sas stored processes for creating great visualisations

General Approach to make a new “Viz”

Page 104: Sas stored processes for creating great visualisations

Find an example▪ Pick a visualisation ▪ Close to something you want ▪ Could be changed to meet needs ▪ Could be combined with other things to meet needs ▪ Check it for suitability ▪ Some things are easier than others ▪ Is it free? ▪ Handle libraries ▪ Make sure you are pointing to a local copy or CDN ▪ Copy & Test locally

Page 105: Sas stored processes for creating great visualisations

Number Display Example

<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/crossfilter/1.3.11/crossfilter.min.js"></script> <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/dc/1.7.3/dc.min.js"></script>

<script type="text/javascript" src="../js/d3.js"></script> <script type="text/javascript" src="../js/crossfilter.js"></script> <script type="text/javascript" src="../js/dc.js"></script>

http://dc-js.github.io/dc.js/examples/cust.html

Page 106: Sas stored processes for creating great visualisations
Page 107: Sas stored processes for creating great visualisations

Wrap in a Stored Process▪ Write code to _WEBOUT using ▪ Data step ▪ Proc Stream ▪ Mixture of both ▪ Leave out the %stpbegin & %stpend macros ▪ Call using Stored Process Web Application from browser

http://server57562.uk2net.com/SASStoredProcess/do?_program=%2FUser+Folders%2FPhil+Mason%2FMy+Folder%2Fd3+-+data+step

Page 108: Sas stored processes for creating great visualisations
Page 109: Sas stored processes for creating great visualisations

Use Proc Stream with PRESCOL

Page 110: Sas stored processes for creating great visualisations

What should we change?▪ Parameters ▪ So we can control what it does ▪ Data ▪ So it works using our data ▪ Libraries ▪ Often they point to resources on another web site ▪ Can copy to our web site ▪ Can use Content Delivery Network (CDN)

Page 111: Sas stored processes for creating great visualisations

Parameters▪ Identify anything we want to alter ▪ If it is a one time change, then make the change ▪ If we want to change it from run to run, then it is a

candidate for macros ▪ Identify anything we want to add, e.g. a title

Page 112: Sas stored processes for creating great visualisations

Data▪ Identify where the data is coming from ▪ What format is it in? ▪ We will need to make our data in same format ▪ Consider options for reproducing data

Page 113: Sas stored processes for creating great visualisations

How to change things?▪ Macro variables ▪ Replace shorter things we want to control ▪ Macro programs ▪ Replace longer things we want to control ▪ Make use of looping, conditions, dataset I/O, file I/O,

etc.

Page 114: Sas stored processes for creating great visualisations
Page 115: Sas stored processes for creating great visualisations

Change width and height to a macro variable

Page 116: Sas stored processes for creating great visualisations

Add corresponding parameters to Stored Process

Page 117: Sas stored processes for creating great visualisations

Use parms in call to Stored Processhttp://server57562.uk2net.com/SASStoredProcess/do?_program=%2FUser+Folders%2FPhil+Mason%2FMy+Folder%2Fd3+-+macroed&w=400&h=400

Page 118: Sas stored processes for creating great visualisations

▪ Can just make a flat file ▪ Can make a stored process to deliver data ▪ Data Step ▪ Proc Stream

Make data into a CSV “file”

Page 119: Sas stored processes for creating great visualisations

Make a Stored Process to deliver data

Page 120: Sas stored processes for creating great visualisations

Modify Stored Process to use data from Stored Process▪ Use the d3.csv function to read in CSV data into a

JavaScript array. ▪ Remove the hard-coded data ▪ Add a call to load data ▪ All code needs to be inside function

▪ Finish off function call at the end with })

Page 121: Sas stored processes for creating great visualisations

Stored Process using macro parms and another Stored Process for data

Page 122: Sas stored processes for creating great visualisations

Where have we go to?▪ Stored Process for Program ▪ Creates HTML, JavaScript, CSS ▪ Stored Process for Data ▪ Produces a stream of CSV data ▪ Possibly copies of libraries on our Infrastructure ▪ CSS ▪ JavaScript ▪ We have a working little JavaScript/SAS Stored Process

Visualisation Web Application!

Page 123: Sas stored processes for creating great visualisations

Next Steps▪ Add more graphs to these 3 based on the same data ▪ Parameterise the data used ▪ Change variables too ▪ Make them all Stored Process parameters ▪ Therefore they are also macro variables

▪ Change Stored Process making data to be general purpose by feeding a dataset name to it.

▪ Create several Stored Processes like this and combine them to make a dashboard.

Page 124: Sas stored processes for creating great visualisations

Repeat object(s) to make a Dashboard▪ We don't have time for this, but basic steps are … ▪ Create a bunch of empty div sections in HTML 5 ▪ perhaps just with a H1 so you can see them ▪ Make some CSS to lay them out how you like ▪ easy to do accordions, tabs, sliding layouts, etc. ▪ Use some jQuery to fill the div sections ▪ use Ajax calls to do it ▪ Possibly add some drop down selections lists, etc. ▪ Use jQuery to add info from there to your Ajax calls

▪ That’s about it!

Page 125: Sas stored processes for creating great visualisations

Conclusion

Page 126: Sas stored processes for creating great visualisations

Conclusions▪ It’s easy to find great JavaScript visualisation software ▪ It’s easy to wrap it up and customise it with a Stored

Process ▪ It’s easy to feed it with data from another Stored Process ▪ Combine some of these into a dashboard or application ▪ Put it all together and you have yourself a powerful

cutting edge visualisation system.

Page 127: Sas stored processes for creating great visualisations

Extras

Page 128: Sas stored processes for creating great visualisations

Some great links to useful resources

Page 129: Sas stored processes for creating great visualisations

http://www.robslink.com/SAS/Home.htm

Page 130: Sas stored processes for creating great visualisations

http://www.visualisingdata.com/index.php/

Page 131: Sas stored processes for creating great visualisations

http://www.jsgraphs.com/

Page 132: Sas stored processes for creating great visualisations

http://www.graphviz.org/Gallery.php

Page 133: Sas stored processes for creating great visualisations

http://www.highcharts.com/demo

Page 134: Sas stored processes for creating great visualisations

http://www.amcharts.com/demos/

Page 135: Sas stored processes for creating great visualisations

https://github.com/mbostock/d3/wiki/Gallery

Page 136: Sas stored processes for creating great visualisations

http://dc-js.github.io/dc.js/

Page 137: Sas stored processes for creating great visualisations

Some great diagrams

Page 138: Sas stored processes for creating great visualisations