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

Hello community

 

I'm going to code up something that submits the "ps -ef" command on Unix. In fact, I've already done that and I'm able to read it in quite nicely.

 

The problem is, SAS will determine which Unix server it runs against via the Grid head node. What I'd prefer, is that I am able to forcibly select each specific server n Grid boxes and n LASR boxes so I can run this command on all of them.

 

I suspect I may need to actually create a .sh file in Unix to do this for me and call that via SAS, but if anyone knows how to do this in SAS I'd be greatful for some insight.

 

Here's a snapshot of where I've got to so far.

%macro Zombies(server);

	data _null_;
/*		do i = 1 to countw("&ServerList.",'|');*/
			ps = "ps -efl | sort -k 4n,4 | grep ""defunct"" > /dir/dir/dir/defunct.txt";
			call system (ps);
/*		end;*/
	;run;

%mend;
%Zombies(servername);

Thanks in advance,

 

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
_Dan_
Quartz | Level 8

Hi there

 

I've ended up coding this up into a macro which ssh's across the LASR nodes from whatever Grid box it's running on. It's driven by a txt file which contains all LASR server names, and ssh's across, submitting the 'ps' command and storing the output into a separate file, suffixed with each server name.

 

It's the most elegant solution I could find, but I'll have a look at these agents. We're on 9.4_M3.

 

 

Cheers,

 

Dan

View solution in original post

2 REPLIES 2
LinusH
Tourmaline | Level 20
What version are you on?
If 9.3 or above you are most likely to have Environment Manager that via agents can collect this information for you.
Data never sleeps
_Dan_
Quartz | Level 8

Hi there

 

I've ended up coding this up into a macro which ssh's across the LASR nodes from whatever Grid box it's running on. It's driven by a txt file which contains all LASR server names, and ssh's across, submitting the 'ps' command and storing the output into a separate file, suffixed with each server name.

 

It's the most elegant solution I could find, but I'll have a look at these agents. We're on 9.4_M3.

 

 

Cheers,

 

Dan

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 351 views
  • 0 likes
  • 2 in conversation