DATA Step, Macro, Functions and more

Run SAS query from backend

Reply
Occasional Contributor
Posts: 6

Run SAS query from backend

I want to run SAS programs from backend and have the result and log to be stored in permanent folder.
Can someone help to get the command
PROC Star
Posts: 1,269

Re: Run SAS query from backend

Posted in reply to aranganayagi
Super User
Posts: 10,211

Re: Run SAS query from backend

Posted in reply to aranganayagi

Do you mean to run programs in batch without user intervention?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 6

Re: Run SAS query from backend

Posted in reply to aranganayagi
I want to run the program and have the result even if the session is closed or disconnected
Super User
Super User
Posts: 9,599

Re: Run SAS query from backend

Posted in reply to aranganayagi

In what?  You haven't provided any information.  What software are you using, is it server based, local install.  What type of program.  

If a session is closed prematurely then it stops at the point it was running at normally.

Occasional Contributor
Posts: 6

Re: Run SAS query from backend

Posted in reply to aranganayagi
I am running sas program in server. Whenever LAN is disconnected, the programs are getting aborted. I heard there is one command called nohup, Can someone help to get the exact command and how to use it.
Super User
Posts: 10,211

Re: Run SAS query from backend

Posted in reply to aranganayagi

@aranganayagi wrote:
I am running sas program in server. Whenever LAN is disconnected, the programs are getting aborted. I heard there is one command called nohup, Can someone help to get the exact command and how to use it.

That's an easy one.

As soon as you have something that can be run from the commandline (eg a SAS program that can be run with the supplied sasbatch.sh), do

nohup sasbatch.sh program.sas &

The & at the end moves the program to the background (you immediately get your prompt back, and are shown the number of the background process). nohup prevents the sendig of a SIGHUP to the process in case the connection fails/is terminated.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 6 replies
  • 56 views
  • 0 likes
  • 4 in conversation