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

Hello,

 

A colleague is executing a sas program via a terminal window of winscp, on a unix server and it start well.

However, as the execution last at least 10 hours, the terminal window will closed after let's say few hours then causing the sas program to stop.

Is there a way to avoid that and if so how.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

In my experience a shell terminal to a Linux OS can close after a time, either due to firewall timeout or (with us working from home) a temporary network disconnect.

 

The best approach is to run any long-running process asynchronously so it is not interrupted when the shell window disconnects. Use the & terminator on the command, which returns control immediately back to the shell.  Example:

 

/usr/local/bin/sas mysasbatch.sas -log ./logs/mysasbatch.log &

 

When you return to find the shell disconnected, simple "shell in" again and check the contents of the SAS log.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

View solution in original post

2 REPLIES 2
ChrisHemedinger
Community Manager

In my experience a shell terminal to a Linux OS can close after a time, either due to firewall timeout or (with us working from home) a temporary network disconnect.

 

The best approach is to run any long-running process asynchronously so it is not interrupted when the shell window disconnects. Use the & terminator on the command, which returns control immediately back to the shell.  Example:

 

/usr/local/bin/sas mysasbatch.sas -log ./logs/mysasbatch.log &

 

When you return to find the shell disconnected, simple "shell in" again and check the contents of the SAS log.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
alepage
Barite | Level 11

Hello,

 

I am glad to see that your are using almost the same command as we are usually do.

Most of the time, we usually use a command like this one:

 

nohup path/sasprogram.sas &

 

and normally we don't have any issue.  As we have received the question on our internal sas forum, 

I did not have a chance to talk to that person due to time zone.

 

Thanks a lot for your advise.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1459 views
  • 0 likes
  • 2 in conversation