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

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@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

2 REPLIES 2
Patrick
Opal | Level 21

@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

BonnaryW
Obsidian | Level 7

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

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

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