SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
ctrip08
Calcite | Level 5

I'm having an issue where if I manually run the VBS file that SAS Enterprise Guide generates for scheduling the project runs perfectly; however, when I schedule the VBS file in Windows Task Scheduler the script does not execute. I see the cscript start in task manager and then it closes as if the project ran but none of the files are extracted and there isn't any informaiton added to the project log.

 

Can anyone provide a solution to this problem?

2 REPLIES 2
MadhuKorni
Quartz | Level 8

Once check the path of the script is mentioned correctly or not.

 

Also check the authentication details are provided correctly or not.

Cameron
Fluorite | Level 6

The problem might be that you do not have the correct user rights when running the script under the task scheduler.  You may need to provide your full username (including your user domain) and password to allow the the task scheduler to log in as you when scheduling your schedule. 

 

 

If it is not simply your user log in then it sounds like your project is encountering an error while it is running.   You do not get anything displaying in the project log because nothing is saved unless the script completes successfully.  Also, the error being generated does not usually appear in the project log because the error is originating from the commands running in the cscript shell, not the SAS Enterprise Guide application. 

 

If you open the visual basic script that SAS Enterprise Guide creates then you can edit the script to make it produce an error message. This editing can be done in SAS Enterprise Guide or a text editor such as Notepad.

 

Near the bottom of the script there should be a line that reads:

'MsgBox strmsg 'Uncomment this line if you want to be notified via MessageBox of Errors in the script.

If you remove the single quote and change the line to read:

 MsgBox strmsg 'Uncomment this line if you want to be notified via MessageBox of Errors in the script.

Then the script will produce a WINDOWS error message.

 

How Windows presents any script error message will depend on how Windows runs the script. If the script is run with cscript.exe then it might just appear in the command window that cscript.exe is run from, which may not be visible for long enough after the script finishes. However, if the script is run by wscript.exe then an OK message box will pop up on screen when the script encounters an error. To make this happen you may need to play with the windows task scheduler - if you have the rights to do so.  

 

 

 

If the problem is not caused by a log on problem, it could be that Windows is trying to run a 32-bit version of the script when it should be running a 64 bit version, or vice versa.  This is where the error messages get more obscure as they may say that the application cannot be found. Depending on your version of windows, and SAS Enterprise Guide, you may need to use either a 32 bit or 64 bit version of cscript.exe to run.  Sometimes, the task scheduler only runs the 32 bit version, when you need the 64 bit version.  Other times the 64 bit version is being run when you need to run the 32 bit version.  Trouble is windows switches between the 32 bit version and the 64 bit version depending on whether your runtime environment is 32 bit or 64 bit and there is no easy way of telling the script that it needs to run in a different environment than the current runtime environment as the runtime commands are the same in both environments as windows does some fancy directory renaming in the background.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2708 views
  • 0 likes
  • 3 in conversation