<?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: Running VB from SAS EG in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/294543#M61448</link>
    <description>&lt;P&gt;It looks like your VB script is trying to open an MS Word document. If EG is connecting to a remote Windows SAS server there is no console environment for Word to open in hence your script fails. I strongly suspect your script will only work with local SAS on your PC.&lt;/P&gt;</description>
    <pubDate>Sat, 27 Aug 2016 00:20:26 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2016-08-27T00:20:26Z</dc:date>
    <item>
      <title>Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/294378#M61416</link>
      <description>&lt;P&gt;Hi All - I am having a hard time making the VB script work from EG. We are migrating from PC SAS to SAS EG, but the below piece of code doesnt work. Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT face="Calibri"&gt;&lt;FONT size="3"&gt;&lt;FONT color="#000000"&gt;Below macro runs VBScript &lt;STRONG&gt;vbscript.vbs&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000" size="3"&gt;. PFA script. This vbscript reads ‘test.doc’ and creates &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000000" size="3"&gt;vbscript.txt&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000" size="3"&gt; file.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;%macro test;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;filename vbscript pipe "cscript vbscript.vbs" console=min;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;data _null_;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile &lt;FONT color="#2e75b6" face="Calibri" size="2"&gt;vbscript &lt;/FONT&gt;;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stop;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;run;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;%mend test;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;options mprint;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: rgb(46, 117, 182); font-size: 10pt;"&gt;&lt;FONT face="Calibri"&gt;%test;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="font-family: Symbol;"&gt;&lt;FONT size="3"&gt;·&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 7pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;When we ran this code from BASE SAS 9.4, the file &lt;FONT face="Calibri"&gt;vbscript&lt;/FONT&gt;.txt is created successfully. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="font-family: Symbol;"&gt;&lt;FONT size="3"&gt;·&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 7pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;When we ran script ff44f002.vbs from command prompt, the file &lt;FONT face="Calibri"&gt;vbscript&lt;/FONT&gt;.txt is created successfully.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="font-family: Symbol;"&gt;&lt;FONT size="3"&gt;·&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 7pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Calibri"&gt;&lt;FONT color="#000000" size="3"&gt;But when we ran this macro code from SAS Enterprise Guide, the file file vbscript.txt is &lt;/FONT&gt;&lt;U&gt;&lt;FONT color="#000000" size="3"&gt;not getting created&lt;/FONT&gt;&lt;/U&gt;&lt;FONT color="#000000" size="3"&gt;. We getting below note in the log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;SPAN style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;Stderr output:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;SPAN style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;C:\Documents\vbscript.vbs(8, 1) Microsoft Word: This command is not available because &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;SPAN style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;no document is open.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;SPAN style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;Content of vb script is as below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;SPAN style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;"&gt;dim objwd&lt;BR /&gt;dim mytest&lt;BR /&gt;set objwd = wscript.createobject("Word.Application")&lt;BR /&gt;objwd.visible=false&lt;BR /&gt;fname="C:\Documents\test.doc"&lt;BR /&gt;objWD.documents.open(fname),false, true,false&lt;BR /&gt;outname="C:\Documents\vbscript.txt"&lt;BR /&gt;objwd.activedocument.saveas(outname),5&lt;BR /&gt;objwd.documents.close&lt;BR /&gt;objwd.application.quit&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 13:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/294378#M61416</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-08-26T13:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/294485#M61443</link>
      <description>&lt;P&gt;By any chance does your new EG environment involve a server? The file paths would all have to be something the server can use. This may mean moving some of your files to a shared network location or another approach that lets both you as user and the server read and write files to a location.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 17:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/294485#M61443</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-26T17:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/294543#M61448</link>
      <description>&lt;P&gt;It looks like your VB script is trying to open an MS Word document. If EG is connecting to a remote Windows SAS server there is no console environment for Word to open in hence your script fails. I strongly suspect your script will only work with local SAS on your PC.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 00:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/294543#M61448</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-08-27T00:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298145#M62667</link>
      <description>&lt;P&gt;Sorry for the late response. Yes, EG is connecting to a remote server and I beleive that is the reason the script fails. Is there any other way to achieve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 20:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298145#M62667</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-09-13T20:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298146#M62668</link>
      <description>&lt;P&gt;Yes, our new EG environment is connecting to a remote windows server. we are actually creating the file at a shared location, but still not able to exeucte the script.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 20:43:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298146#M62668</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-09-13T20:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298169#M62675</link>
      <description>&lt;P&gt;So you want MS WORD to open a .doc file and save it as a .txt file?&lt;/P&gt;
&lt;P&gt;Is MS&amp;nbsp;WORD installed on the server?&lt;/P&gt;
&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi﻿&lt;/a&gt;&amp;nbsp;said I am unsure how/if WORD opens when no viewing port is available. Something that you mat want to test before proceeding.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 23:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298169#M62675</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-09-13T23:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298178#M62677</link>
      <description>&lt;P&gt;What does your VB script do apart from opening MS Word? The bottom line is that MS Word is not designed to be opened remotely on a server.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 00:03:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298178#M62677</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-09-14T00:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298196#M62686</link>
      <description>&lt;P&gt;The script will try to open the word instance and copy the content to a text file.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 02:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298196#M62686</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-09-14T02:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298197#M62687</link>
      <description>&lt;P&gt;Yes, MS Word is instaled on the server.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 02:18:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298197#M62687</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-09-14T02:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298495#M62783</link>
      <description>&lt;P&gt;EG is very limiting in terms of what you control&amp;nbsp;compared to SAS. One of the reasons is that everything now runs on a server.&lt;/P&gt;
&lt;P&gt;Try starting MS word like this to see what happens. It should appear in the list of processes on the server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename TEST pipe '____path_to_office___\winword.exe';
data _null_; infile TEST; input; put _infile_; run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The /x switch may help, even though we are not doing DDE here (untested).&amp;nbsp;See&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.office.com/en-gb/article/Command-line-switches-for-Microsoft-Office-Word-2007-8be53d5f-9f13-4987-a91e-b272aac5d39d" target="_blank"&gt;https://support.office.com/en-gb/article/Command-line-switches-for-Microsoft-Office-Word-2007-8be53d5f-9f13-4987-a91e-b272aac5d39d&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 05:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298495#M62783</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-09-15T05:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298976#M62955</link>
      <description>&lt;P&gt;I see this in the log file. Also, I dont see an instance of word process opening on the server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The infile TEST is:&lt;/P&gt;
&lt;P&gt;Unnamed Pipe Access Device,&lt;/P&gt;
&lt;P&gt;PROCESS=C:\Program Files (x86)\Microsoft Office\Office14\winword.exe,&lt;/P&gt;
&lt;P&gt;RECFM=V,LRECL=32767&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 16:32:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/298976#M62955</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-09-16T16:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB from SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/299054#M62971</link>
      <description>What's the data step log output?  Have you tried the X switch?</description>
      <pubDate>Fri, 16 Sep 2016 22:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-VB-from-SAS-EG/m-p/299054#M62971</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-09-16T22:58:57Z</dc:date>
    </item>
  </channel>
</rss>

