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

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
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

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.

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
  • 741 views
  • 1 like
  • 2 in conversation