Desktop productivity for business analysts and programmers

See the SAS jobs in backend

Reply
Contributor
Posts: 61

See the SAS jobs in backend

Hi experts,

 

I am looking for a way by which , i can see the .sas codes in backend server (Linux) that I am running on SAS EG.

 

The thing that I am having now is, when i open SAS EG and run a .sas code , i am seeing a process on back end linux (from ps aux command) which shows me the spawned process . But it does not show me the actual .sas code that i am running.

 

Can anyone suggest.

 

 

Super User
Posts: 9,866

Re: See the SAS jobs in backend

Posted in reply to suchismita

What for? You can see the code in EG anyway.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Trusted Advisor
Posts: 1,737

Re: See the SAS jobs in backend

Posted in reply to suchismita

Hello @suchismita,

 

SAS EG can show the node in the flow that you are running, and if you open the Log tab, you can even see the last procedure or data step that has run, even. I think you are covered there. If any of those are not clear to you, please let us know.

 

In other hand, if what you are looking for is something somewhat more advanced, I would like to strongly recommend you to give a look to Enterprise Session monitor (ESM) , a great SAS process monitoring tool created by Boemska ( @boemskats I hereby summon you ). This tool would allow to include tags in your code and you can see the performance of your jobs, and you will see the tags in the monitoring tool, hence, you can recognise exactly what is being executed and its performance. https://boemskats.com/esm/ 

Contributor
Posts: 61

Re: See the SAS jobs in backend

Posted in reply to JuanS_OCS

@JuanS_OCS Thanks. I understand the point you are saying about checking the EG log and seeing what was the last proc run.

But I am looking for something different. Let's say I ran a sas code with the name test1.sas from SAS EG( As usual it will have multiple proc and data steps inside ) . Then one of my colleague ran a .sas code with the name test2.sas from his SAS EG session.

 

So in that case will I be able to see how many .sas codes are running from which user on the backed server side (Linux). Something like ps -fu or ps -ef.

 

If we will run a program from back end server, we will for sure see that in ps -fu or ps -ef. Similar kind of thing I am looking for .sas codes those are running from  SAS EG.

 

Please let me know if I made my point clear.

Super User
Posts: 9,866

Re: See the SAS jobs in backend

Posted in reply to suchismita

You can't see that with ps (and you should be mighty thankful for this, see later). A workspace server process is started by EG when it's first needed (to run a project node, or to display in the server list), and is kept until the server connection or EG as such is closed. All communication runs through the IOM bridge and not over the command line.

You can modify logconfig.xml so that complete logs of everything that's done from EG are written to the server, and inspect those logs.

 

If ps were able to read into user processes like that, UNIX would be one gaping security hole that no-one beyond utter moron level would use. Of course that's not the case.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Trusted Advisor
Posts: 1,737

Re: See the SAS jobs in backend

Posted in reply to suchismita

@suchismita, things are as @KurtBremser well said.

 

Did you had the chance to see the link about Enterprise Session Manager, made by Boemska ( @boemskats )?

 

Again,as Kurt mentioned, EG session is a Workspace Server session, but not all Workspace Server sessions are EG's. hence you need to make a difference, right?

 

Option A, is to have a separated Workspace Server, enable EG users to see and use ONLY that SASApp-Workspace server, and then you can monitor the sessions on this SASApp.

 

Option B, is to use additional tools, as the referred ESM one.

 

Option C, which can be used in B as well, is to add a session variable as (EG - Username) and monitor-parse the logs and create a small tool of your own. Of course, this would require some time from yourself or your teams. In the past I did it, but found that not worth: why re-invent the wheel? It is already out there.

Super User
Posts: 9,866

Re: See the SAS jobs in backend

Posted in reply to suchismita

Addendum: once you have activated server-side logging of workspace servers, you can scan the log(s) for the latest entries

%LET _CLIENTTASKLABEL='Program';
%LET _CLIENTPROCESSFLOWNAME='Process Flow';

where the text in the macro variable will contain the name of the current project node, and the name of the process flow, likewise.

 

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

Re: See the SAS jobs in backend

Posted in reply to suchismita

Hi,

 

Thanks for the mention @JuanS_OCS. Getting more granular insight into EG session behaviour is one of the bigger selling points of our product, as one of  allows developers to see what they're doing, understand efficiencies within their code & take responsibility for the workload they generate. 

 

I made a .gif (~3min long) to demonstrate something similar to your use case. Note that this does not require enabling Workspace Server logging or any increased logging (so the performance impact is negligible / nonexistent).

 

2018-06-11 13 01 13

 

You won't get the name of the program, but you'll get the task labels, alongside realtime info on things like CPU, I/O throughput generated by the task, SASWork size, etc. Hopefully the .gif displays correctly. Any questions, let me know.

 

 

Nik

Contributor
Posts: 61

Re: See the SAS jobs in backend

Posted in reply to boemskats

@boemskats Thanks. This needs an additional installation of ESM. Does that come with SAS products or we have to purchase it separately? 

Ask a Question
Discussion stats
  • 8 replies
  • 249 views
  • 2 likes
  • 4 in conversation