<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Scheduling issue? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Scheduling-issue/m-p/674608#M36618</link>
    <description>&lt;P&gt;Hello, I have built a process flow, and to schedule this task, i v build a order list as well, name 'orderlist' under 'ordered list'. To schedule this orderlist, I modified the schedule vbs as blow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;==========================&lt;/P&gt;&lt;P&gt;Option Explicit&lt;BR /&gt;Dim app ' As SASEGuide.Application&lt;/P&gt;&lt;P&gt;Call dowork&lt;/P&gt;&lt;P&gt;'shut down the app&lt;BR /&gt;If not (app Is Nothing) Then&lt;BR /&gt;app.Quit&lt;BR /&gt;Set app = Nothing&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Sub dowork()&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;'----&lt;BR /&gt;' Start up Enterprise Guide using the project name&lt;BR /&gt;'----&lt;BR /&gt;Dim prjName ' As String&lt;BR /&gt;Dim prjObject ' As SASEGuide.Project&lt;BR /&gt;Dim containerName ' As String&lt;BR /&gt;Dim containerObject ' As SASEGuide.Container&lt;BR /&gt;Dim containerColl ' As SASEGuide.ContainerCollection&lt;/P&gt;&lt;P&gt;prjName = "C:\Users\xfx89651\250_50_Project.egp" ' Project Name&lt;BR /&gt;containerName = "OrderedList" ' Container Name&lt;BR /&gt;&lt;BR /&gt;Set app = CreateObject("SASEGObjectModel.Application.7.1")&lt;BR /&gt;If Checkerror("CreateObject") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;Set prjObject = app.Open(prjName,"")&lt;BR /&gt;If Checkerror("App.Open") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'-----&lt;BR /&gt;'Get The Container Collection and Object&lt;BR /&gt;'-----&lt;BR /&gt;Set containerColl = prjObject.ContainerCollection&lt;BR /&gt;If Checkerror("Project.ContainerCollection") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;Dim i ' As Long&lt;BR /&gt;Dim j ' As Long&lt;BR /&gt;Dim count ' As Long&lt;BR /&gt;Dim count_OL ' As Long&lt;BR /&gt;count = containerColl.count&lt;BR /&gt;For i = 0 To count - 1&lt;BR /&gt;Set containerObject = containerColl.Item(i)&lt;BR /&gt;If Checkerror("ContainerCollection.Item") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;If (containerObject.Name = "Ordered Lists") Then&lt;BR /&gt;count_OL = containerOjbect.items.count&lt;BR /&gt;For j = 0 to count_OL - 1&lt;BR /&gt;if Checkerror("ContainerCollection.Item") = True Then&lt;BR /&gt;Exit SUb&lt;BR /&gt;End if&lt;BR /&gt;Set orderedListObject = containerObject.items.item(j)&lt;BR /&gt;if (orderedListObject.name = containerName) then&lt;BR /&gt;exit for&lt;BR /&gt;Else&lt;BR /&gt;set orderedlistObject = Nothing&lt;BR /&gt;end if&lt;BR /&gt;Next&lt;BR /&gt;Exit For&lt;BR /&gt;Else&lt;BR /&gt;Set containerObject = Nothing&lt;BR /&gt;Set orderedListObject = Nothing&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;If not (containerObject Is Nothing) Then&lt;BR /&gt;'----&lt;BR /&gt;' Run the Container&lt;BR /&gt;'----&lt;BR /&gt;containerObject.Run&lt;BR /&gt;If Checkerror("Container.Run") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;'-----&lt;BR /&gt;' Save the new project&lt;BR /&gt;'-----&lt;BR /&gt;prjObject.Save&lt;BR /&gt;If Checkerror("Project.Save") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;'-----&lt;BR /&gt;' Close the project&lt;BR /&gt;'-----&lt;BR /&gt;prjObject.Close&lt;BR /&gt;If Checkerror("Project.Close") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Function Checkerror(fnName)&lt;BR /&gt;Checkerror = False&lt;BR /&gt;&lt;BR /&gt;Dim strmsg ' As String&lt;BR /&gt;Dim errNum ' As Long&lt;BR /&gt;&lt;BR /&gt;If Err.Number &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;strmsg = "Error #" &amp;amp; Hex(Err.Number) &amp;amp; vbCrLf &amp;amp; "In Function " &amp;amp; fnName &amp;amp; vbCrLf &amp;amp; Err.Description&lt;BR /&gt;'MsgBox strmsg 'Uncomment this line if you want to be notified via MessageBox of Errors in the script.&lt;BR /&gt;Checkerror = True&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;====&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a strange thing is that, when I execute the vbs and it can generate the output successfully. But, when I create schedule in EG and link the schedule with the vbs, the ouput is not successfully produced.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would experts can give me some suggestions on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2020 22:30:41 GMT</pubDate>
    <dc:creator>Jonison</dc:creator>
    <dc:date>2020-08-04T22:30:41Z</dc:date>
    <item>
      <title>Scheduling issue?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Scheduling-issue/m-p/674608#M36618</link>
      <description>&lt;P&gt;Hello, I have built a process flow, and to schedule this task, i v build a order list as well, name 'orderlist' under 'ordered list'. To schedule this orderlist, I modified the schedule vbs as blow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;==========================&lt;/P&gt;&lt;P&gt;Option Explicit&lt;BR /&gt;Dim app ' As SASEGuide.Application&lt;/P&gt;&lt;P&gt;Call dowork&lt;/P&gt;&lt;P&gt;'shut down the app&lt;BR /&gt;If not (app Is Nothing) Then&lt;BR /&gt;app.Quit&lt;BR /&gt;Set app = Nothing&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Sub dowork()&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;'----&lt;BR /&gt;' Start up Enterprise Guide using the project name&lt;BR /&gt;'----&lt;BR /&gt;Dim prjName ' As String&lt;BR /&gt;Dim prjObject ' As SASEGuide.Project&lt;BR /&gt;Dim containerName ' As String&lt;BR /&gt;Dim containerObject ' As SASEGuide.Container&lt;BR /&gt;Dim containerColl ' As SASEGuide.ContainerCollection&lt;/P&gt;&lt;P&gt;prjName = "C:\Users\xfx89651\250_50_Project.egp" ' Project Name&lt;BR /&gt;containerName = "OrderedList" ' Container Name&lt;BR /&gt;&lt;BR /&gt;Set app = CreateObject("SASEGObjectModel.Application.7.1")&lt;BR /&gt;If Checkerror("CreateObject") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;Set prjObject = app.Open(prjName,"")&lt;BR /&gt;If Checkerror("App.Open") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'-----&lt;BR /&gt;'Get The Container Collection and Object&lt;BR /&gt;'-----&lt;BR /&gt;Set containerColl = prjObject.ContainerCollection&lt;BR /&gt;If Checkerror("Project.ContainerCollection") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;Dim i ' As Long&lt;BR /&gt;Dim j ' As Long&lt;BR /&gt;Dim count ' As Long&lt;BR /&gt;Dim count_OL ' As Long&lt;BR /&gt;count = containerColl.count&lt;BR /&gt;For i = 0 To count - 1&lt;BR /&gt;Set containerObject = containerColl.Item(i)&lt;BR /&gt;If Checkerror("ContainerCollection.Item") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;If (containerObject.Name = "Ordered Lists") Then&lt;BR /&gt;count_OL = containerOjbect.items.count&lt;BR /&gt;For j = 0 to count_OL - 1&lt;BR /&gt;if Checkerror("ContainerCollection.Item") = True Then&lt;BR /&gt;Exit SUb&lt;BR /&gt;End if&lt;BR /&gt;Set orderedListObject = containerObject.items.item(j)&lt;BR /&gt;if (orderedListObject.name = containerName) then&lt;BR /&gt;exit for&lt;BR /&gt;Else&lt;BR /&gt;set orderedlistObject = Nothing&lt;BR /&gt;end if&lt;BR /&gt;Next&lt;BR /&gt;Exit For&lt;BR /&gt;Else&lt;BR /&gt;Set containerObject = Nothing&lt;BR /&gt;Set orderedListObject = Nothing&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;If not (containerObject Is Nothing) Then&lt;BR /&gt;'----&lt;BR /&gt;' Run the Container&lt;BR /&gt;'----&lt;BR /&gt;containerObject.Run&lt;BR /&gt;If Checkerror("Container.Run") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;'-----&lt;BR /&gt;' Save the new project&lt;BR /&gt;'-----&lt;BR /&gt;prjObject.Save&lt;BR /&gt;If Checkerror("Project.Save") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;'-----&lt;BR /&gt;' Close the project&lt;BR /&gt;'-----&lt;BR /&gt;prjObject.Close&lt;BR /&gt;If Checkerror("Project.Close") = True Then&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Function Checkerror(fnName)&lt;BR /&gt;Checkerror = False&lt;BR /&gt;&lt;BR /&gt;Dim strmsg ' As String&lt;BR /&gt;Dim errNum ' As Long&lt;BR /&gt;&lt;BR /&gt;If Err.Number &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;strmsg = "Error #" &amp;amp; Hex(Err.Number) &amp;amp; vbCrLf &amp;amp; "In Function " &amp;amp; fnName &amp;amp; vbCrLf &amp;amp; Err.Description&lt;BR /&gt;'MsgBox strmsg 'Uncomment this line if you want to be notified via MessageBox of Errors in the script.&lt;BR /&gt;Checkerror = True&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;====&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a strange thing is that, when I execute the vbs and it can generate the output successfully. But, when I create schedule in EG and link the schedule with the vbs, the ouput is not successfully produced.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would experts can give me some suggestions on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 22:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Scheduling-issue/m-p/674608#M36618</guid>
      <dc:creator>Jonison</dc:creator>
      <dc:date>2020-08-04T22:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Scheduling issue?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Scheduling-issue/m-p/675594#M36667</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277798"&gt;@Jonison&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out the following SAS notes for EG Scheduling assistance:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/59079" target="_blank"&gt;http://support.sas.com/kb/59079&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/56648" target="_blank"&gt;http://support.sas.com/kb/56648&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally, here's a webinar link that steps through the debug process:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Ask-the-Expert/SAS-Enterprise-Guide-Scheduling-Projects/ta-p/506514" target="_blank"&gt;https://communities.sas.com/t5/Ask-the-Expert/SAS-Enterprise-Guide-Scheduling-Projects/ta-p/506514&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 13:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Scheduling-issue/m-p/675594#M36667</guid>
      <dc:creator>fifthand57th</dc:creator>
      <dc:date>2020-08-10T13:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scheduling issue?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Scheduling-issue/m-p/676603#M36723</link>
      <description>&lt;P&gt;If it works as expected when you manually run the .vbs file, you are very close to having it working via scheduling.&amp;nbsp; Another thing to check is to make sure you are using the proper version of cscript.exe that matches your EG bitness.&amp;nbsp; For example, if you are using 32-bit EG, then the program/script on the Action tab in your Windows Scheduled task should be:&lt;/P&gt;
&lt;P&gt;C:\Windows\SysWOW64\cscript.exe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using 64-bit EG, it should be:&lt;/P&gt;
&lt;P&gt;C:\Windows\System32\cscript.exe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In both cases, the "Add arguments" field should contain the quoted full path to your .vbs file.&amp;nbsp; For example:&lt;BR /&gt;"C:\fullPathToVBSFile\EGScript1.vbs"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 21:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Scheduling-issue/m-p/676603#M36723</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2020-08-13T21:21:33Z</dc:date>
    </item>
  </channel>
</rss>

