BookmarkSubscribeRSS Feed
sburnos
Fluorite | Level 6

Dear SAS community,

 

I hope you could help me in the following:

I have created a batch .cmd file, where I execute multiple SAS codes. This batch perfectly works if I do simply double click on it. 

Now I tried to run the batch via the Task Scheduler. And sometimes it works, and sometimes I get an error "sas.exe has stopped working". This error happens only for the second part of the .cmd, meaning that the first part, which includes one SAS code executes just fine, but the second SAS execution crashes. And this is happens from time to time, while testing I observed crashes in 70-80% of executions.

 

Here is my .cmd file:

set file_path=XXX
set file_path_log =XXX_log

set file_path_lst=XXX_lst

 

"\\vm19003\c$\program files\SASHome\SASFoundation\9.4\sas.exe" -sysin "%file_path%.sas" -LOG "%file_path_log%" -PRINT "%file_path_lst%" -NOSPLASH -NOLOGO -ICON

 

TIMEOUT /T 10

 

::----------------------------------------------------------------------
set file_path=YYY
set file_path_log =YYY_log

set file_path_lst=YYY_lst

 

"\\vm19003\c$\program files\SASHome\SASFoundation\9.4\sas.exe" -sysin "%file_path%" -LOG "%file_path_log%" -PRINT "%file_path_lst%" -NOSPLASH -NOLOGO -ICON


exit /b

 

And here is the Task Scheduler action:

cmd.exe/c "Path_to_cmd_file"

 

Looking forward for your recommendations!

Sergey

1 REPLY 1
LinusH
Tourmaline | Level 20

Always hard to understand when it doesn't work sometimes. Try find additional logs that might shed some more light over the issue.

Things to look out for:

- the account used by Windows Task != yours

- if using system account, usually it's hard to access UNC (file shares) locations

Data never sleeps

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 405 views
  • 1 like
  • 2 in conversation