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
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).
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.
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!
Any well-administrated server provides access through SSH, unless your IT is run by Mordacs.
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
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.
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
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).
Thank you very much KurtBremser, I've just made a test and it has worked
Regards
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.
@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.
I think it's a problem with the connection to the Internet rather than a server problem
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.