Help using Base SAS procedures

VBScript not running manually or in task scheduler

Reply
New Contributor
Posts: 3

VBScript not running manually or in task scheduler

Hi,

Can somebody tell me what is wrong with the code below?  It wont run manually or with the task scheduler.  It has worked in the past but stopped working for some reason.

Any help would be much appreciated.

Option Explicit
Dim app
Dim container
Dim orderedList
Dim n
Dim p


Call dowork

If not (app Is Nothing) Then
    app.Quit
    Set app = Nothing
End If


Sub dowork()
    On Error Resume Next
    Dim prjName
    Dim prjObject

    prjName = "C:\My Data\ReportDocs_DRC_Daily_Sales\SAS_DailySales.egp"
     
    Set app = WScript.CreateObject("SASEGObjectModel.Application.4.3")

    Set prjObject = app.Open(prjName,"")

    Set container = prjobject.ContainerCollection

    For n=0 to (container.Count -1)

                if container(n).ContainerType = 5 then
                Set orderedList = container(n).Items
                  for p=0 to (orderedList.Count -1)
                                orderedList(p).run
                  Next
                end if
    Next

    prjObject.run
    prjObject.Save
    prjObject.Close
      
End Sub

Trusted Advisor
Posts: 2,113

Re: VBScript not running manually or in task scheduler

"Doesn't run" is pretty broad.  Any specifics?  I'm not a VB programmer, so I can't help on the specifics of the code.

In general, if something that used to run, stops running, I look for changes in the environment.  Can you still run any scheduled tasks?  Perhaps IT removed or restricted  that capability for users.  New OS?  Other new software?

New Contributor
Posts: 3

Re: VBScript not running manually or in task scheduler

Hi,

The script use to run on my old laptop with Windows 7 but recently upgraded to a new machine.  The script opens the SAS query, closes and saves it but doesnt run the actually query.  i can tell because the time on the query has changed.  Could it be a system setting I need to change?

Any help would be great.

Thanks,

Diane

Trusted Advisor
Posts: 2,113

Re: VBScript not running manually or in task scheduler

See if you can run anything from vb?

See if you can run an EG project with the scheduler?

Then get up with your IT support folks.

New Contributor
Posts: 3

Re: VBScript not running manually or in task scheduler

I have escalated this to the IT Folks as I think it could be an system setting on my laptop.  I can run it on my old laptop no problem.

Thanks so much for your help.

Ask a Question
Discussion stats
  • 4 replies
  • 578 views
  • 0 likes
  • 2 in conversation