<?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 Running SAS EG Ordered List from a Batch (*.bat) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-EG-Ordered-List-from-a-Batch-bat/m-p/333835#M22193</link>
    <description>&lt;P&gt;I am wanting to open SAS EG from a *.bat file and run the ordered List.&amp;nbsp; I can get my .bat to open my project by using "Start K:\Dental_Database\Project_Dental.egp".&amp;nbsp; However what is the correct syntax to have it open and run the ordered List?&lt;/P&gt;</description>
    <pubDate>Fri, 17 Feb 2017 16:31:56 GMT</pubDate>
    <dc:creator>MRW</dc:creator>
    <dc:date>2017-02-17T16:31:56Z</dc:date>
    <item>
      <title>Running SAS EG Ordered List from a Batch (*.bat)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-EG-Ordered-List-from-a-Batch-bat/m-p/333835#M22193</link>
      <description>&lt;P&gt;I am wanting to open SAS EG from a *.bat file and run the ordered List.&amp;nbsp; I can get my .bat to open my project by using "Start K:\Dental_Database\Project_Dental.egp".&amp;nbsp; However what is the correct syntax to have it open and run the ordered List?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2017 16:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-EG-Ordered-List-from-a-Batch-bat/m-p/333835#M22193</guid>
      <dc:creator>MRW</dc:creator>
      <dc:date>2017-02-17T16:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Running SAS EG Ordered List from a Batch (*.bat)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-EG-Ordered-List-from-a-Batch-bat/m-p/335602#M22293</link>
      <description>&lt;P&gt;You can accomplish using EG's automation interface...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Open your EG project and note the name of the ordered list you want to run (ex. "MyOrderList") and the parent folder (ex. "Ordered Lists").&lt;/P&gt;
&lt;P&gt;-Click File-&amp;gt;Schedule &amp;lt;projectName&amp;gt;, then click OK in the scheduler dialog to cause an EGScript1.vbs file to be created in the same directory as your EG project.&amp;nbsp; (EGScript1.vbs is a VBScript file that will use the EG automation interface to open your project, run your project, save it, and then close it.)&lt;/P&gt;
&lt;P&gt;-Close your project.&lt;/P&gt;
&lt;P&gt;-Run the EGScript1.vbs file (ex. "cscript.exe EGScript1.vbs")&amp;nbsp; (Note: If running 32-bit EG on 64-bit Windows, you'll have to use the 32-bit cscript.exe in c:\Windows\SysWOW64...&amp;nbsp; ex. "c:\Windows\SysWOW64\cscript.exe EGScript1.vbs".)&lt;/P&gt;
&lt;P&gt;-Open your project in EG and confirm it was run by executing the VBScript file.&lt;/P&gt;
&lt;P&gt;-After confirming EGScript1.vbs successfully ran your entire project, now we just need to edit it to only run the desired Ordered List.&amp;nbsp; For example, replace the portion of the EGScript1.vbs that runs the project (commented out below) with code that finds and runs the desired ordered list (example below):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    '-----
    ' run the project
    '-----
    'prjObject.run
    'If Checkerror("Project.run") = True Then
    '    Exit Sub
    'End If
    
    'Find and Run the desired ordered list
    Dim orderedListContainer
    Dim orderedList

    Set orderedListContainer = prjObject.ContainerCollection.Item("Ordered Lists")
    For Each orderedList in orderedListContainer.Items
        If orderedList.Name = "MyOrderList" Then
            orderedList.Run()
        End If
    Next
    If Checkerror("OrderedList.Run") = True Then
        Exit Sub
    End If&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;-The last step (assuming you really want to be able to do this from a batch file), is to run the VBScript file from your batch file.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;@echo off
pushd %~dp0
cscript EGScript1.vbs&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-EG-Ordered-List-from-a-Batch-bat/m-p/335602#M22293</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2017-02-24T14:50:01Z</dc:date>
    </item>
  </channel>
</rss>

