Using Scripts to Automate SAS Administration Support

11/14/2016 by Nick Welke Support

In our experience, second-tier tasks in SAS environments are often best performed through automation via scripts. Implementation requires an incisive understanding of both the underlying platform and its constraints, and the role that various processes and files play in a SAS environment. Nick Welke expands on how Zencos provides both through the ZenGuard™ service.

Nick, most SAS environments have code to handle first-tier priorities, from ETL to statistical processing and reporting. What does this “standard code,” if you will, leave to be desired?

Well, it needs support. The second-tier code we implement helps automate some of these first-tier processes and carry them out predictably. As part of our work with remote SAS sites, we have implemented a variety of scripts in Linux, UNIX and Windows environments to help with disk space, memory usage, runaway processes and checking logs for errors. Some of the automation we put in place allows our partners to forgo hiring an on-site SAS administrator.

So why use externally implemented code, rather than leaving these second-tier processes to the IT System Administrators?

With most areas of “SAS Administration,” there is a duality to the scripts needed to support the environment.  SAS Administrators bridge the gap between a company’s IT world and the business world, because they understand both: first, the technical constraints of the system hosting the SAS environment, and second, the kind of data analysts need and how to present it in the most efficient manner. Almost all of the scripts Zencos implements for SAS Administration can be placed on a continuum from primarily “IT” functionality — resource reporting, file archiving, service status, etc. — to varying degrees of “Business” functionality — data availability checks, dataset sharing, post-processing error checks, metadata library and user updates.

Okay, so what kinds of scripts should a company use? Can you give recommendations to a company that is trying to avoid hiring an in-house SAS administrator?

Four generic scripts that provide immediate benefit are a Status Check Script for SAS services, an Error Check Script, a License Check Script and a Disk Space Check Script.  While these examples are almost universally applicable to SAS environments, we scale implementation and customize the scripts depending on the existing monitoring tools and intended audience of the reports. Typically these scripts are then refined by the SAS Administration Team and eventually “promoted” into the IT System Administrators’ hands once the scripts are mature and stable.

Let’s do a high-level overview of the four scripts you mentioned, specifically the benefit or business function each fulfills.

Sure. The purpose of a Status Check Script is to monitor the environment’s key components (SAS Servers) and alert the support team if anything looks out of order. A secondary goal would be to collect data on resource usage for review at a later date.

The Error Check Script searches through log files for any ERROR messages and alerts support staff that they may need to investigate. Since SAS logs can be extensive and may produce a large number of ERROR messages that are not really problematic, it is useful to have a false-positive lookup file against which to check any observed ERROR messages in order to avoid flooding the support team with messages they will ignore anyway. A secondary goal is to create a history of observed errors, even false positives, to be able to provide context for troubleshooting, particularly once a third party such as SAS Technical Support needs to get involved. Having a history of errors has on occasion accelerated problem resolution by directing technical support staff to the original “false positive” error that later caused a real problem.

A License Check Script monitors the site’s licensed servers for SAS license expiry and notifies the site’s SAS contact of a need to renew software. Although SAS licensing provides for generous Warning and Grace periods, it is often the case that the number of steps and groups involved between recognizing the need for a new license and having it installed can take more than the default 90-days. To mitigate this, a script can be run to notify the SAS administrator before that 90-day clock starts counting down. The License Check Script is a simple way of checking for the expiry date, and can be appended to normal error checks or system status checks.

Finally, the purpose of the Disk Space Check Script is to notify the SAS administrator that datasets are taking disk space and optionally take some action based on pre-defined rules.  There are generally two categories of datasets to flag with a script like this. The first is the collection of permanent user-owned datasets that are old and could possibly be archived.  The second is the collection of temporary datasets left over when user sessions were abruptly ended without giving SAS the opportunity to clean up.

How would a company know exactly what scripts they should add to their existing processes to ensure they make well-informed business decisions?

It’s a difficult issue, often, trying to decide what scripts you absolutely need to help you function more efficiently and what scripts are “nice to have.” But regardless of your current capabilities, there are numerous instances where the second-tier tasks around a SAS environment are best served by automation through scripts. These second-tier priorities often require a consultant who has a grasp of the technical capabilities of the given environment and an understanding of the business goals a company is trying to meet. That’s where ZenGuard becomes so useful; it’s a way of providing that kind of dedicated support remotely, so that even companies without the means to have in-house SAS administrators can take advantage of an expert’s understanding of these environments.

In the end, after all, it’s about collecting and simplifying data in a consumable fashion so a company or business leader can make an informed decision. As always, efficiencies are important. Automations allow us to help streamline the collection of data and determine how actionable that data is, all in an effort to help our partners use their resources more efficiently.

Contact Nick Welke for a personalized assessment.