BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sajid01
Meteorite | Level 14

Hello ALL

I was wondering if we cound proc metaoperate or some other procedure to pause SAS stored process server and resume it after some time?

1 ACCEPTED SOLUTION

Accepted Solutions
JuanS_OCS
Amethyst | Level 16

Hello @Sajid01,

 

I wonder what is your purpose or requirement, for "pausing" just the SAS Stored Process Server.

 

You could, of course, with some code, identify the sas.exe processes that are being launched as Stored Processes. This it not very complicated, just identifying the path used in those executions (including (StoredProcess string), and you will never have more than the size of your pool for the SAS Stored Process Server.

 

A different story is the "pausing" part... I think it is perfectly possible, but not as a "pause" state but as a "non accessible" state. 

You could create a SAS code, with some IOM code, for denying Read Metadata to SASUSERS (and to SAS Trusted user and SAS General Services, if you will), while ensuring full access to the SAS Administrators (to ensure you won't corrupt the access to the SAS Stored Process). In this way, nobody can launch Stored Processes anymore, not even system services (just SAS Admins).

 

You would need, of course, another code to revert this status back to original state.

 

An alternative to above, much easier perhaps, is to make export original state of STP server, then  change of permissions manually when nobody access the STP server, then export SAS Package of the STP server definition. With those 2 packages, you can create a one-line code to import the package when you want to enable, or disable the STP server.

Look for the utilities in SASPlatformObjectFramework\9.4\ExportPackage.exe and SASPlatformObjectFramework\9.4\ImportPackage.exe

 

With all of this, the procedure could be such as:

- disable STP server (with IOM or just Export/Import package codes)

- kill remaining SAS STP processes

 

- when you are ready, enable back the STP server

 

is it simple enough? I hope it might help you.

 

Best regards,

Juan

View solution in original post

6 REPLIES 6
SimonDawson
SAS Employee

Signals on Linux and UNIX can be used to manage process execution. You could pause all execution of code in SAS Stored Processes by finding the process ID's of the Stored Process servers then sending them SIGSTOP to pause their execution. Once you want them executing again sending it a SIGCONT will get them running again.

Sajid01
Meteorite | Level 14

Thanks

I am working on a windows environment.

sureshprabhu153
Fluorite | Level 6

Thanks for the information

SimonDawson
SAS Employee
A quick Google search revealed there isn’t any utility built into the operating system to do this on Windows but there are thread management calls in the Windows API.
https://stackoverflow.com/questions/11010165/how-to-suspend-resume-a-process-in-windows

I’ll give some thought to how you might do this without resorting to manipulating the operating system process table entry. There is probably a smarter way to do this that works across all platforms SAS runs on.
JuanS_OCS
Amethyst | Level 16

Hello @Sajid01,

 

I wonder what is your purpose or requirement, for "pausing" just the SAS Stored Process Server.

 

You could, of course, with some code, identify the sas.exe processes that are being launched as Stored Processes. This it not very complicated, just identifying the path used in those executions (including (StoredProcess string), and you will never have more than the size of your pool for the SAS Stored Process Server.

 

A different story is the "pausing" part... I think it is perfectly possible, but not as a "pause" state but as a "non accessible" state. 

You could create a SAS code, with some IOM code, for denying Read Metadata to SASUSERS (and to SAS Trusted user and SAS General Services, if you will), while ensuring full access to the SAS Administrators (to ensure you won't corrupt the access to the SAS Stored Process). In this way, nobody can launch Stored Processes anymore, not even system services (just SAS Admins).

 

You would need, of course, another code to revert this status back to original state.

 

An alternative to above, much easier perhaps, is to make export original state of STP server, then  change of permissions manually when nobody access the STP server, then export SAS Package of the STP server definition. With those 2 packages, you can create a one-line code to import the package when you want to enable, or disable the STP server.

Look for the utilities in SASPlatformObjectFramework\9.4\ExportPackage.exe and SASPlatformObjectFramework\9.4\ImportPackage.exe

 

With all of this, the procedure could be such as:

- disable STP server (with IOM or just Export/Import package codes)

- kill remaining SAS STP processes

 

- when you are ready, enable back the STP server

 

is it simple enough? I hope it might help you.

 

Best regards,

Juan

sasdrs2
Calcite | Level 5

Try PROC IOMOPERATE.  See statements for QUIESCE and PAUSE.

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
  • 6 replies
  • 1617 views
  • 3 likes
  • 5 in conversation