03-05-2017 08:47 AM - edited 03-05-2017 08:48 AM
When i select Schedule Program A and choose Repeat task every 1 hour and indefinitely. Then the Schedule creates the vbs (and the Run times tabs show the expected run time.
But it haven't run at all.
Any idea ?
03-05-2017 10:41 PM
I've found that I need to create the files myself to ensure they all work as required.
If you have scheduled a task, you should see it in the Windows Task Scheduler (TS) program.
If you go the TS >> find your Task >> right click & open the properties >> go to the 'Actions' tab & you'll see the path to the .vbs file that runs the SAS EG Project.
Double click on that file to see if it runs the Project (Make sure the Project runs quickly or coment some parts out so you don't have to wait around to test this).
If it runs the project, the issue is with the Task at the Task Scheduler end (which it usually is I've found).
Try these steps & let me know how you go.
03-05-2017 11:09 PM - edited 03-05-2017 11:11 PM
Thank you for your help. I have tried to open The VBS file either by Double click it in window environment and by CMD environment, it just run without prompting anything ( as below).
it runs without opening EG
P.S The vbs created by SAS EG
I have either closed the program and left it on for testing
I test it by exporting a dataset to local directory at the end of the process , but it never create the dataset neither overwrite it once.
Do you have any idea ?
03-06-2017 04:15 PM - edited 03-06-2017 04:20 PM
You can test if the .vbs file works by adding a MsgBox comment inside the script.
Sub dowork() On Error Resume Next '---- ' Start up Enterprise Guide using the project name '---- Dim prjName Dim prjObject Dim containerName ' As String Dim containerObject ' As SASEGuide.Container Dim containerColl ' As SASEGuide.ContainerCollection prjName = "G:\Database_Project.egp" 'Project Name 'Add code here MsgBox "Hi I'm working!" Rest of code below here ...
Now if you double click the file, you should see a dialogue box pop up.
Let me know if it doesn't happen.
Next we want to check that TS is working to run this .vbs file.
The process is that TS creates a batch file that has the path to the .vbs file & it's the .vbs file that triggers the SAS EG project.
Go to your TS & right click to go to Properties >> & on the Actions tab.
Highlight the path in the Actions box & click on 'Edit'
Amend your details in the Actions Tab to what's shown in the Attached picture.
Ensure you add " " around the path of the .vbs file shown in the 'Add arguments (optional)' box.
On the General tab, use the 'Run only when User is logged on & all other stttings can stay the same for now.
We want to get to a stage where the running of the Task in TS gets you a Pop up message from the .vbs file.
So now save everything, go to TS & right click on the task & click 'Run'.
Let me know how you go.
03-07-2017 02:24 PM
If this process is a business-critical one then I would advise against scheduling this on a PC. Your SAS server is designed for handling these tasks a lot better and a lot more reliably. Of course I'm assuming here that your EG uses a SAS remote server. If you are using local SAS on the PC then please ignore my comment.