BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kalind_Patel
Lapis Lazuli | Level 10

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.Smiley Happy

 

Please find below GIF to see how these scripts work.

Start SAS services script :

 

Start_Services.gif

 

Stop SAS services script :

 Stop_Services.gif

1 ACCEPTED SOLUTION

Accepted Solutions
Kalind_Patel
Lapis Lazuli | Level 10

Hello @SASKiwi;

 

Thanks for your valuable feedback Smiley Happy !

 

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 :

 

Spoiler

sc start/stop "SAS [%variable%-Lev1] SAS Environment Manager Agent" >nul 

 

to this lines:

 

 

Spoiler

 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

 

View solution in original post

4 REPLIES 4
SASKiwi
PROC Star

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?   

Kalind_Patel
Lapis Lazuli | Level 10

Hello @SASKiwi;

 

Thanks for your valuable feedback Smiley Happy !

 

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 :

 

Spoiler

sc start/stop "SAS [%variable%-Lev1] SAS Environment Manager Agent" >nul 

 

to this lines:

 

 

Spoiler

 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

 

JacobSimonsen
Barite | Level 11
Thank you, it was something like that I needed when I updated to SAS 9.4M4 a few days ago.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

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.

Discussion stats
  • 4 replies
  • 6624 views
  • 14 likes
  • 3 in conversation