DATA Step, Macro, Functions and more

Setting TERM environment variable while executing Unix command in EG

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Setting TERM environment variable while executing Unix command in EG

Hi Gurus,

 

I was trying to execute some Unix System command's using Enterprise Guide. 

 

Code Snippet is as follows:

                      filename test pipe 'top';
                      data top_result;
                      length buffer $1000 ;
                      infile test dlm="-";
                      input buffer;
                      run;

 

However while executing I am getting as TERM environment variable not set.

 

The intention of the above code was to fetch the sessions running from Unix end.

 

Can you please advice on this.


EG_TERMVARIABLE.JPG

Accepted Solutions
Solution
‎05-27-2016 12:26 PM
Super User
Posts: 7,863

Re: Setting TERM environment variable while executing Unix command in EG

Posted in reply to sudipta_goswami

TERM (adressed as $TERM) is a UNIX environment variable that contains the type of the attached terminal for interactive sessions. Programs that create formatted output need that so they can (using a library called curses) create the correct control character sequences for screen position, highlighting, colours etc.

 

top does this, as it displays a dynamic view of the system's operation. Therefore it needs to position the cursor for screen updates.

 

In particular, I think that top is not the correct choice for what you want. It runs indefinitely until it receives the quit ("q") command and updates the screen, so it is a very poor choice for the filename pipe, as that expects a static sequential list as input.

 

I'd rather start with something that creates nice list output, like ps.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
‎05-27-2016 12:26 PM
Super User
Posts: 7,863

Re: Setting TERM environment variable while executing Unix command in EG

Posted in reply to sudipta_goswami

TERM (adressed as $TERM) is a UNIX environment variable that contains the type of the attached terminal for interactive sessions. Programs that create formatted output need that so they can (using a library called curses) create the correct control character sequences for screen position, highlighting, colours etc.

 

top does this, as it displays a dynamic view of the system's operation. Therefore it needs to position the cursor for screen updates.

 

In particular, I think that top is not the correct choice for what you want. It runs indefinitely until it receives the quit ("q") command and updates the screen, so it is a very poor choice for the filename pipe, as that expects a static sequential list as input.

 

I'd rather start with something that creates nice list output, like ps.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 14

Re: Setting TERM environment variable while executing Unix command in EG

Posted in reply to KurtBremser

Thanks a ton Kurt

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 188 views
  • 1 like
  • 2 in conversation