Anand Vyas
As more and more organizations have started to adopt DevOps tools and practices, automating systems and services is the norm to achieve accuracy, reliability and avoid any human errors. Many organizations have integrated their SAS® platform with these toolsets to achieve maximum automation. In this paper, we will discuss how we can automate start/stop of SAS® LASR Analytic server by making API calls using PROC HTTP.
SAS® LASR Analytic server allows multi-user access to in-memory data. It supports both single machine and distributed computing workloads. This data is consumed by high performance products like SAS® Visual Analytics.
If you administer a SAS® platform with SAS® LASR Analytic server, you might be aware that you need to login to SAS® Visual Analytics Administrator user interface to start the server process. On Linux platform SAS® provides an out-of-the-box startup script “sas.servers” to start and stop SAS® platform services.
Automate and integrate start/stop of SAS® LASR Analytic servers using “sas.servers” script using PROC HTTP.
Login to SAS® Compute server where SAS® LASR Analytic server context has been configured using Installer account (e.g. “sas”) and navigate to your SAS® configuration directory (e.g. “/<sasconfig-path>/Lev1”)
Download the SAS® program “lasr_ops.sas” and shell script “LASROps.sh” under the configuration directory. Links to GitHub repository are shared below.
Edit the SAS® program “lasr_ops.sas” and provide username and password.
Edit the shell script “LASROps.sh” and updated the SAS® configuration directory path at your site.
By default, log output is pointed to LASR Administrator’s account (e.g. “lasradm”) home directory. You can also redirect the log to any location where the user has access.
If you have the sudo permission correctly configured you can run below commands to start, stop and check status of the LASR servers.
To integrate this batch process into “sas.servers” script you will have to edit out-of-the-box “sas.servers.mid” script. In this script, at the end there is a case statement where you need to add the above command. Replace “/sasconfig/Lev1” path to match at your site.
Note: It’s a good practice to take backup of any out-of-the-box file that you change.
Example below:
By default, status output is written to a text file “lasr_status.txt” under SAS® LASR Administrator account home directory on Linux based system. If you want to run this code on Windows based system you can modify the location to any path where the user has access to write.
Example below:
Download the full SAS code and shell script from the below links.
lasr_ops.sas: https://raw.githubusercontent.com/vyasanand/LASROps/master/lasr_ops.sas
LASROps.sh: https://raw.githubusercontent.com/vyasanand/LASROps/master/LASROps.sh
This automation can be useful in SAS environments in scenarios where:
This code is an example on how PROC HTTP can be used to automate SAS® LASR Analytic server operations using APIs. There are other ways to automate start/stop LASR servers using PROC LASR procedure or by enabling autoload option on the LASR library.
Using this approach SAS® LASR Analytic server would start in exactly same way as a user would do via user interface. This helps to automatically trigger any add-on properties like “reload-on-restart”, if enabled.
HTTP Procedure
https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=proc&docsetTarget=n0bd...
The ABCs of PROC HTTP
https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf
What’s New in SAS Environment Manager Administration
Your comments and questions are valued and encouraged. Contact the author at:
Anand Vyas
Thakral One PTE LTD.
Technical Consultant
Great article on automating SAS LASR Analytic server operations! I’ve been exploring similar automation for my team’s workflow. While implementing batch scripts, we often face challenges with monitoring execution logs effectively. Do you recommend any best practices for real-time log tracking during server start/stop processes?
On a related note, I came across Work Time, which offers some interesting insights into task tracking and automation tools. Would you say such platforms could complement SAS environment monitoring, or is it better to stick with native tools for this use case?
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Ready to level-up your skills? Choose your own adventure.