Build & Deploy HTML5  Apps on Viya and SAS 9

Why JavaScript?

  • Security
  • Scalability
  • Built for Interfaces

FREE*

  • ​Security
  • Scalability
  • Built for Data

FREE*

Why SAS?

Architecture

Separation of front and backend is non-negotiable!

  • Maintainability
  • Speed of development (workflow)
  • Forward compatibility (SAS 9 -> Viya)

Front vs Back

  • User Experience (UX)
  • User Interface (UI)
  • Design Frameworks

Design

User Experience

Layout / Graphic Design

 

User Interface

Frameworks

  • Authentication
  • Authorisation
  • Stuff to watch out for
    • OS credential misuse
    • Code injection
    • Man-in-the-middle attacks

Security

<script src="https://cdn.jsdelivr.net/npm/sasjs@2.1.0/index.js" 
  integrity="sha256-aO07O1dqIVfURrXrgsYbCxneXml0Q+kMQI/RpGKR3mo=" 
  crossorigin="anonymous">
</script>

Use SubResource Integrity (SRI) hashing to avoid Man-In-The-Middle attacks

SRI Hashing

Backend Permissions

A Framework for HTML5 App Development on SAS

SAS js

SAS Utility Macros for Application Development

  • Many functions, eg:
    • Create Folders
    • Create Services
    • Get Users & Groups
  • Online Documentation 
  • Both SAS 9 and Viya

sasjs/core

Bi-directional data transfer between JS and SAS

  • SASLogon integration
  • Both SAS 9 and Viya
  • Extensive test suite

sasjs/adapter

Setup, build & deploy SAS projects

  • "Opinionated" Project Structure
  • Documentation driven approach
  • Tooling to accelerate DevOps & Deployment

sasjs/cli

SAS 9 SAS VIYA
Stored Processes Job Execution Service
WKS / STP Servers Compute Server only
Client / System Identities Client / System* Identities
Metadata Postgres

* System account available with Viya 3.5+

Backend

Doxygen

  • Frameworks
  • Seed Apps
  • Dev Ops

Frontend

  • Angular
  • React
  • Vue

Frameworks

Seed Apps

Tips & Tricks

Send only the data you need to send!

  • SAS is fast and extremely powerful for data management
  • Corporate laptops are unlikely to be very "modern" 
  • Minimise client side rendering and IO
  • Avoid 'stateful' services (eg STP sessions) as they can impact load balancing

Presummarisation

Server side data caching significantly improves the responsiveness for large queries - simply store the output data alongside a hash of the input query

  • Requires a cache management system (lookup tables)
  • Proactive cache generation avoids the 'initial query' cost 
  • Be sure to remove stale caches when source data is refreshed

Server Caching

  • filename _webout cache;
  • yourserver/SASStoredProcess/?_action=1063&_path=/your/path

Miscellaneous

Gotchas

  • Don't use "endsas;" or "abort cancel"
    • ​messes up the load balancing
    • alternative - open a macro, but don't end it!

 

Check out the mp_abort macro

Error Handling

  • User Guide
  • Configuration Guide
  • Deployment Guide
  • Developer Guide

Documentation

  • markdown-to-html
  • MkDocs
  • Doxygen
  • Sphinx / 

Doc Generators

  • Browserstack
  • Cypress
  • Selenium
  • sasjs/test-framework

Testing

More Resources

Building Web Apps with SASjs

By Allan Bowe

Building Web Apps with SASjs

This deck accompanies our workshop on building web apps on Viya and SAS 9 using SASjs.

  • 1,265