Architecting, installing and maintaining your SAS environment

Long running sas jobs

Reply
Contributor
Posts: 64

Long running sas jobs

Hi There,

 

Can anyone help me in finding out way to list out all sas jobs/Processes running from different users on my linux box.

I do not want to use any OS command. Just any SAS specific  commands , that would show the result.

I tried following https://blogs.sas.com/content/sasdummy/2016/02/15/using-proc-iomoperate/ 

It threw me an error like ERROR: Not connected to an IOM Server that supports the LIST SPAWNED SERVERS command.

 

Do I need to have admin rights for executing this command. Is there a way to get the process detail without being a SAS admin.

Super User
Posts: 9,925

Re: Long running sas jobs

Posted in reply to suchismita

Did you connect to the spawner operator port, usually port 8581?

Please post your code.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 64

Re: Long running sas jobs

Posted in reply to KurtBremser

Thanks KurtBremser, That worked.

Can you please let me know where can I get this port 8581?

 

 

I am now able to use the whole code mentioned in https://blogs.sas.com/content/sasdummy/2016/02/15/using-proc-iomoperate/ 

 

Now my next task is to find out the processes those are are running for more than 10 hours. 

In the final report I am getting three columns with datetime format.

1st column is LastCounterReset ( Does it says the process end time or anything else) , which has following value (on 1st observation).

 

19DEC2017:09:09:08


2nd column is Uptime (What is this time) ? Which has following value (on 1st observation) .

 

 19DEC2017:09:09:07


3rd column is StartTime (is it process start time) ? Which has following value (on 1st observation) .

 

19DEC2017:09:09:07 

 

Can you please help me in understanding these times and how to find a difference between start time and end time (or the time when process is stuck).

So by seeing the duration of process, I will decide which process to kill. I will just kill the user processes and not the SAS/SASSRV processes. 

 

Thanks a lot ,

Suchi

Super User
Posts: 9,925

Re: Long running sas jobs

Posted in reply to suchismita

suchismita wrote:

Thanks KurtBremser, That worked.

Can you please let me know where can I get this port 8581?

 

 



It's all a case of following Maxim 1 (Read the documentation), preceded by use of Maxim 6 (Google is your friend)

I googled "sas proc iomoperate" and followed the first result: http://documentation.sas.com/?docsetId=biasag&docsetTarget=n20000intelplatform00srvradm.htm&docsetVe...

There I opened the examples and selected example 7 (CONNECT and LIST Examples Using a Spawner), as that deals with the command in your initial ERROR message. The example contains the port.

 

You will also find that port in your metadata via SMC when browsing the Spawner configuration, it's the operator port.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 9,925

Re: Long running sas jobs

Posted in reply to suchismita

Regarding those timestamps: you see that they are all very close, I'd take uptime for the time when the process was started.

LastCounterReset might have something to do with the packet counter of the TCP/IP connection, but that's just a guess.

 

If you want to know when a certain workspace server process "got stuck", you will have to enable extended logging, and then look at the timestamp in the last line of the log of a given process. If that is quite old, you may assume that the process "hangs". Note that I would not automatically kill processes without human interaction, as it takes quite a lot of intelligence to determine if a job is really dead/stuck in an infinite loop, or just taking a long time to finish its task.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Valued Guide
Posts: 531

Re: Long running sas jobs

Posted in reply to suchismita

While fully endorsing the response from my peers a word of caution. Are you certain that the iomoperate approach will capture your entire SAS workload? Depending on your topology you may have SAS jobs that are started from some batch scheduling mechanism, possibly LSF / Process Manager. These jobs will not show up in iomoperate output but can make up a good part of the total workload. Monitoring of this workload must be approached differently.

 

If you only have workspace servers and other IOM server initiated tasks like stored processes and SAS/Connect sessions than you are safe.

 

Hope this helps,

-- Jan.

Contributor
Posts: 64

Re: Long running sas jobs

Posted in reply to jklaverstijn

Hi Jklaverstjin,

 

That is true. As of now we just have EG and interactive/batch  sas jobs(from Linux). We may proceed further and use LSF/PM.

If you have any better approach in capturing the jobs that is running from EG or interactive sas sessions, please suggest.

My purpose is to find out jobs that is running more than 8 hours and email  to users fro killing them.

 

I know Linux OS can provide that facility but I would like go with a sas oriented path.

 

Thanks,

Suchi

Ask a Question
Discussion stats
  • 6 replies
  • 347 views
  • 6 likes
  • 3 in conversation