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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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