BookmarkSubscribeRSS Feed

Start/Stop SAS LASR Analytic Server using PROC HTTP

Started ‎03-15-2021 by
Modified ‎04-16-2021 by
Views 1,169
Paper 1071-2021

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.



  • This code works on/after SAS® Release version 9.4 M6.
  • You need to have SAS® LASR Analytic server installed and configured at your site
  • Sudo privileges to SAS® Installer account (e.g. “sas”) to execute shell script as SAS® LASR Administrator account (e.g. “lasradm”) without asking for password
  • SAS® Installer account (e.g. “sas”) password to copy script files under the SAS® configuration directory
  • Home directory exists for SAS® LASR Administrator account (e.g. “lasradm”)
  • All other SAS® services including Mid-Tier should be running



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 “” and shell script “” under the configuration directory. Links to GitHub repository are shared below.


Edit the SAS® program “” and provide username and password.



 Edit the shell script “” 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:















Full Code

Download the full SAS code and shell script from the below links.



Sample Use Cases

This automation can be useful in SAS environments in scenarios where:

  • Maintenance
    • During scheduled maintenance window or system restarts, start/stop of SAS® LASR Analytic servers could be automated using this code.
  • Environment Monitoring
    • Proactively monitor status of SAS® LASR Analytic servers.
    • Auto recover SAS® LASR Analytic servers in case of failure.



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




What’s New in SAS Environment Manager Administration


Contact Information:

Your comments and questions are valued and encouraged. Contact the author at:

Anand Vyas

Thakral One PTE LTD.

Technical Consultant



Version history
Last update:
‎04-16-2021 01:00 AM
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Article Labels
Article Tags