Hi All,
I want to share a new idea to manage all sas services in windows using batch,
In Linux or Z/OS we can use sas.servers script to operate all SAS Servers from just one command (./sas.servers start/stop),
But for windows, we don’t have any script like that,
So I have created two batch files to start and stop all SAS Services with other SAS services dependencies ,
And in my testing environment, it is working fine,
I have attached that two scripts in attachment , any feedback, suggestions and questions on this topic would be really appreciated.
Please find below GIF to see how these scripts work.
Start SAS services script :
Stop SAS services script :
Hello @SASKiwi;
Thanks for your valuable feedback !
Currently, in this script, I am using sc start/stop [Service_Name] command to operate the services,
But yes, we can also operate the SAS Environment Manager Agent using hq-agent.bat file,
We have to change this line from .bat file :
sc start/stop "SAS [%variable%-Lev1] SAS Environment Manager Agent" >nul
to this lines:
pushd "D:\SAS\SASConfig\Lev1\Web\SASEnvironmentManager\agent-5.8.0-EE\bin" >nul
call hq-agent.bat start/stop >nul
popd >nul
After that, it will operate SAS Environment Manager Agent service using the hq-agent.bat file.
Thanks,
Kalind
Thanks for the post. We have a very similar scripted process for our Windows SAS servers. It is frustrating that SAS does not provide this, nor is it very well documented what you need to do. We built our version through trial and error and help from our SAS installer.
BTW SAS recommend you start and stop Environment Manager agent using the hq-agent.bat file and not by starting the service directly- is this what you do?
Hello @SASKiwi;
Thanks for your valuable feedback !
Currently, in this script, I am using sc start/stop [Service_Name] command to operate the services,
But yes, we can also operate the SAS Environment Manager Agent using hq-agent.bat file,
We have to change this line from .bat file :
sc start/stop "SAS [%variable%-Lev1] SAS Environment Manager Agent" >nul
to this lines:
pushd "D:\SAS\SASConfig\Lev1\Web\SASEnvironmentManager\agent-5.8.0-EE\bin" >nul
call hq-agent.bat start/stop >nul
popd >nul
After that, it will operate SAS Environment Manager Agent service using the hq-agent.bat file.
Thanks,
Kalind
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.