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

Hi,

I have a problem when I'm running code in EG on a server and my PC suddenly disconnets from the server. I would like to know if there is a way to keep running the code even though my computer shuts down, the internet connection fails or any other problem. Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Next thing, save your code as a .sas file on the server; for a first try, just put it under "Files" in your server in Enterprise Guide.

Then, run it from the commandline:

/sasconf/Lev1/SASApp/BatchServer/sasbatch.sh $HOME/yourprogram.sas -log $HOME/yourprogram.log

Afterwards, you can inspect the log with Enterprise Guide to make sure the code worked.

 

Once that is checked, you can advance to start the command into the background:

nohup /sasconf/Lev1/SASApp/BatchServer/sasbatch.sh $HOME/yourprogram.sas -log $HOME/yourprogram.log &

or set it up to run at a certain time; issue this command:

at -t 201911202350

and enter the first commandline of this post; terminate entering the command by typing a single Ctrl-D.

Tomorrow, check the log. Also log on to the server to see if you got mail (unexpected output from the cron daemon will be sent as internal mail).

 

View solution in original post

12 REPLIES 12
r_behata
Barite | Level 11

Hi @Joseca 

 

Welcome to the SAS Communities.

 

Yes, You can run the SAS Code in Batch mode on the Server to avoid session disconnections.

The commands for executing in Batch mode vary based on your environment . Could you provide some details on the type of server : Unix/windows ? Etc.

 

 

Joseca
Fluorite | Level 6

Hi r_behata,

 

Thank you for your answer.

 

I'm working in a corporative enviroment, I have a SAS EG installed in my PC but I don't have access to the server. I just can access to the server through EG.

 

thanks!

Joseca
Fluorite | Level 6

Thank you for your answer

 

Yes. I've invistegated and I can access through FliZilla and I've seen that the connection type is SSH. Sorry but I'm not an expert at all

Kurt_Bremser
Super User

The most-used program on Windows for SSH connections is PuTTY. You can use it to have command-line access with the same credentials you used in Filezilla.

 

If you want to go the path of running SAS programs in batch from the commandline, first verify that you can log on. Next, get the location of the SAS configuration tree on that server; from there, you can find the sasbatch.sh shell script.

(e.g. /sasconf/Lev1/SASApp/BatchServer/sasbatch.sh)

This can be used to run SAS jobs in the same basic environment you have when connecting to SASApp from Enterprise Guide.

Joseca
Fluorite | Level 6

Ok I have logged with putty and I can access to the path that you said. There is the sasbatch.sh. What should I do now?

 

Thank you very much for your answers

Kurt_Bremser
Super User

Next thing, save your code as a .sas file on the server; for a first try, just put it under "Files" in your server in Enterprise Guide.

Then, run it from the commandline:

/sasconf/Lev1/SASApp/BatchServer/sasbatch.sh $HOME/yourprogram.sas -log $HOME/yourprogram.log

Afterwards, you can inspect the log with Enterprise Guide to make sure the code worked.

 

Once that is checked, you can advance to start the command into the background:

nohup /sasconf/Lev1/SASApp/BatchServer/sasbatch.sh $HOME/yourprogram.sas -log $HOME/yourprogram.log &

or set it up to run at a certain time; issue this command:

at -t 201911202350

and enter the first commandline of this post; terminate entering the command by typing a single Ctrl-D.

Tomorrow, check the log. Also log on to the server to see if you got mail (unexpected output from the cron daemon will be sent as internal mail).

 

Joseca
Fluorite | Level 6

Thank you very much KurtBremser, I've just made a test and it has worked

 

Regards

SASKiwi
PROC Star

At many SAS sites server-based scheduling is available through SAS Management Console, a client-based tool like EG. You don't need to access the SAS server directly. Talk to your SAS administrator about server-based scheduling options.

andreas_lds
Jade | Level 19

@Joseca wrote:

Hi,

I have a problem when I'm running code in EG on a server and my PC suddenly disconnets from the server. I would like to know if there is a way to keep running the code even though my computer shuts down, the internet connection fails or any other problem. Thanks in advance


You should talk to the admins of the server, sudden disconnects is something they should investigate, because it is not normal at all.

Joseca
Fluorite | Level 6

I think it's a problem with the connection to the Internet rather than a server problem

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 12 replies
  • 1778 views
  • 4 likes
  • 5 in conversation