<?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 Re: SAS EG Scripting (VBS) - Command to include a SAS PGM from disk in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274799#M19066</link>
    <description>&lt;P&gt;Thank you!.....Excellent idea!&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2016 20:22:40 GMT</pubDate>
    <dc:creator>mclegry</dc:creator>
    <dc:date>2016-06-02T20:22:40Z</dc:date>
    <item>
      <title>SAS EG Scripting (VBS) - Command to include a SAS PGM from disk</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274769#M19062</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been running a VBS script that starts SAS EG 5.1, dynamically creates a project and runs some SAS Code. However, I have been embedding the SAS code within the VBS script. I would like to have the VBS script include the SAS program from a file on disk rather than embedded within the VBS program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been reading and using several examples from Chris Hemmedinger. However, I cannot find any examples of how to use a SAS program that is stored on disk (called from VBS script). Unfortunately I am a SAS guy and not a Microsoft guy!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any examples?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 19:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274769#M19062</guid>
      <dc:creator>mclegry</dc:creator>
      <dc:date>2016-06-02T19:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Scripting (VBS) - Command to include a SAS PGM from disk</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274788#M19064</link>
      <description>&lt;P&gt;Why not use the %INCLUDE SAS statement to read your SAS program? It would be easy enough for your VB code to run a single SAS %INCLUDE statement to get your remaining code.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 20:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274788#M19064</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-06-02T20:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Scripting (VBS) - Command to include a SAS PGM from disk</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274791#M19065</link>
      <description>&lt;P&gt;%INCLUDE is for reading a SAS program off of the SAS session's file system. &amp;nbsp;I'm guessing that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88382"&gt;@mclegry﻿&lt;/a&gt;&amp;nbsp;wants to slurp in a program from the local machine where EG is running.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would use the FileSystemObject in VBScript to read the content of a local file, and assign that to the sasCode.Text value for your SAS program in the EG object model. &amp;nbsp;Something like this partial program...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile("C:\programs\myprogram.sas", 1)

' add a new code object to the Project
Set sasProgram = Project.CodeCollection.Add
 
' set the results types, overriding Application defaults
sasProgram.UseApplicationOptions = False
sasProgram.GenListing = True
sasProgram.GenSasReport = False
 
' Set the server (by Name) and text for the code
sasProgram.Server = "SASApp"
' Create the SAS program to run
sasProgram.Text = file.ReadAll
 
' Run the code
sasProgram.Run&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jun 2016 20:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274791#M19065</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-06-02T20:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Scripting (VBS) - Command to include a SAS PGM from disk</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274799#M19066</link>
      <description>&lt;P&gt;Thank you!.....Excellent idea!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 20:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274799#M19066</guid>
      <dc:creator>mclegry</dc:creator>
      <dc:date>2016-06-02T20:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Scripting (VBS) - Command to include a SAS PGM from disk</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274800#M19067</link>
      <description>&lt;P&gt;Thank you Chris! This is exactly what I was looking for. SASKiwi also had a good suggestion about using a %INCLUDE. I will try both of these suggestions!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 20:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Scripting-VBS-Command-to-include-a-SAS-PGM-from-disk/m-p/274800#M19067</guid>
      <dc:creator>mclegry</dc:creator>
      <dc:date>2016-06-02T20:24:07Z</dc:date>
    </item>
  </channel>
</rss>

