Architecting, installing and maintaining your SAS environment

run sas.exe in background on windows server 2012 R2

Accepted Solution Solved
Reply
Contributor
Posts: 37
Accepted Solution

run sas.exe in background on windows server 2012 R2

Hello,

 

How can run this this command in a background on windows server 2012 R2.  I used  he Task Scheduler and it's not doing anything.

 

"C:\SASHome\SASFoundation\9.4\Sas.exe" -sysin "C:\SASTEST.sas" -LOG "C:\DATAM\SASTEST.log" -NOSPLASH -NOLOGO -ICON

 

Thank you for any assistance you can provide me.

 


Accepted Solutions
Solution
‎05-19-2017 06:56 PM
Respected Advisor
Posts: 4,173

Re: run sas.exe in background on windows server 2012 R2

[ Edited ]

@BonnaryW

1. Does the batch command work when you execute it out of a command prompt?

2. Has the scheduler ever executed it? What does the history tell you?  https://technet.microsoft.com/en-us/library/cc722006(v=ws.11).aspx

 

 

Are you sure the user used for batch processing got all the required permissions to read and write from/to the chosen locations on your disk?

 

Also: I would be using sas.bat from your Lev<n> environment and not directly sas.exe under Foundation so that you get your environment created in the same way than what you're using out of a SAS EG session.

I would also go for a rollover log so that consecutive executions of your job don't overwrite the log.

 

Here a batch command which should work once you've amended the paths for your environment.

C:\SAS\config\Lev1\SASApp\sas.bat -sysin "C:\SAS\config\Lev1\SASApp\SASEnvironment\Code\testjob.sas" -logparm "rollover=session" -log "C:\SAS\config\Lev1\SASApp\SASEnvironmentLogs\testjob_#Y.#m.#d_#H.#M.#s.log" -print "C:\SAS\config\Lev1\SASApp\SASEnvironment\Output\testjob_#Y.#m.#d_#H.#M.#s.lst" -noterminal -batch -icon -nosplash -metauser "<user>" -metapass "<credentials>

Depending on your environement you probably don't need options -metauser and -metapass

View solution in original post


All Replies
Solution
‎05-19-2017 06:56 PM
Respected Advisor
Posts: 4,173

Re: run sas.exe in background on windows server 2012 R2

[ Edited ]

@BonnaryW

1. Does the batch command work when you execute it out of a command prompt?

2. Has the scheduler ever executed it? What does the history tell you?  https://technet.microsoft.com/en-us/library/cc722006(v=ws.11).aspx

 

 

Are you sure the user used for batch processing got all the required permissions to read and write from/to the chosen locations on your disk?

 

Also: I would be using sas.bat from your Lev<n> environment and not directly sas.exe under Foundation so that you get your environment created in the same way than what you're using out of a SAS EG session.

I would also go for a rollover log so that consecutive executions of your job don't overwrite the log.

 

Here a batch command which should work once you've amended the paths for your environment.

C:\SAS\config\Lev1\SASApp\sas.bat -sysin "C:\SAS\config\Lev1\SASApp\SASEnvironment\Code\testjob.sas" -logparm "rollover=session" -log "C:\SAS\config\Lev1\SASApp\SASEnvironmentLogs\testjob_#Y.#m.#d_#H.#M.#s.log" -print "C:\SAS\config\Lev1\SASApp\SASEnvironment\Output\testjob_#Y.#m.#d_#H.#M.#s.lst" -noterminal -batch -icon -nosplash -metauser "<user>" -metapass "<credentials>

Depending on your environement you probably don't need options -metauser and -metapass

Contributor
Posts: 37

Re: run sas.exe in background on windows server 2012 R2

Thank you so much Patrick.  I will give it a try.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 403 views
  • 3 likes
  • 2 in conversation