<?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: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924987#M364068</link>
    <description>&lt;P&gt;Just as a thought: The vbs script executes as a child process of your parent SAS session. When running in batch and the parent SAS session terminates the child session will get killed if not finished already.&lt;/P&gt;
&lt;P&gt;To test the theory: Use options XWAIT and XSYNC and see if this changes things.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2024 11:49:13 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2024-04-19T11:49:13Z</dc:date>
    <item>
      <title>VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924804#M364012</link>
      <description>&lt;P&gt;VBScript runs successfully when executed from SAS Base, but doesn't work in batch mode (I cannot see any errors).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA _NULL_;&lt;BR /&gt;RC=SLEEP(5);&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;option noxwait;&lt;BR /&gt;option noxsync ;&lt;BR /&gt;data _NULL_;&lt;BR /&gt;rc1=system('path\copy_cal.vbs');&lt;BR /&gt;put rc1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;BR /&gt;RC=SLEEP(5);&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 11:20:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924804#M364012</guid>
      <dc:creator>laika_matias</dc:creator>
      <dc:date>2024-04-18T11:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924923#M364048</link>
      <description>&lt;P&gt;Check the XCMD SAS system option in batch mode to confirm if SAS will let you execute commands in the OS or not:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option = xcmd;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2024 21:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924923#M364048</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-04-18T21:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924975#M364063</link>
      <description>&lt;P&gt;Thank you for your response! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I have checked the XCMD SAS system option in batch mode, and it shows that it is enabled. There are no errors in the log, and everything appears to be working fine. However, the VBScript code still does not seem to execute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="2"&gt;XCMD&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; Enables the X command in SAS.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;NOTE: PROCEDURE OPTIONS used (Total process time):&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;65&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;66&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option&amp;nbsp; noxwait nosyntaxcheck;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;67&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option&amp;nbsp; noxsync ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;68&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;69&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _NULL_;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;70&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc1=system('G:\path\script.vbs');&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;71&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put rc1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;0&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;73&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;74&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc options option=xcmd;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;75&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS (r) Program&amp;nbsp; 9.4&amp;nbsp; TS1M3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;XCMD&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; Enables the X command in SAS.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;NOTE: PROCEDURE OPTIONS used (Total process time):&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 19 Apr 2024 10:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924975#M364063</guid>
      <dc:creator>laika_matias</dc:creator>
      <dc:date>2024-04-19T10:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924987#M364068</link>
      <description>&lt;P&gt;Just as a thought: The vbs script executes as a child process of your parent SAS session. When running in batch and the parent SAS session terminates the child session will get killed if not finished already.&lt;/P&gt;
&lt;P&gt;To test the theory: Use options XWAIT and XSYNC and see if this changes things.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 11:49:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924987#M364068</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-04-19T11:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924988#M364069</link>
      <description>&lt;P&gt;Thank you! but I already have those options added &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 12:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924988#M364069</guid>
      <dc:creator>laika_matias</dc:creator>
      <dc:date>2024-04-19T12:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924995#M364070</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/455373"&gt;@laika_matias&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you! but I already have those options added &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So the SAS log you shared with us is not what you executed? As in the log it's NOxwait and NOxsync&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1713530874530.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95688i80BE60308430E51F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1713530874530.png" alt="Patrick_0-1713530874530.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 12:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924995#M364070</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-04-19T12:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924999#M364072</link>
      <description>&lt;P&gt;I've just tried to execute the code according to the options you provided, but still nothing &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 13:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/924999#M364072</guid>
      <dc:creator>laika_matias</dc:creator>
      <dc:date>2024-04-19T13:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/925000#M364073</link>
      <description>&lt;P&gt;It seems that the 'xwait' option is causing the SAS application to hang while executing its task.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 13:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/925000#M364073</guid>
      <dc:creator>laika_matias</dc:creator>
      <dc:date>2024-04-19T13:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/925023#M364077</link>
      <description>&lt;P&gt;What OS are you running on?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe just to separate the SAS stuff from the VBS script try just running a single command, like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options noxwait xsync ;
data _NULL_;
rc1=system('/*run some command here to make a directory or a file*/');
put rc1;
run;

&lt;/PRE&gt;
&lt;P&gt;You also might try using SYSTASK, something like:&lt;/P&gt;
&lt;PRE&gt;systask command "/*your command here*/" status=mystatus wait shell;  
%put &amp;amp;=mystatus &amp;amp;=sysrc; *both should be 0 if success;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Apr 2024 16:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/925023#M364077</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-04-19T16:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript Executes Successfully in SAS Base, But Fails in Batch Mode Without Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/925031#M364078</link>
      <description>&lt;P&gt;What exactly does "when executed from SAS Base" mean?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/455373"&gt;@laika_matias&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;VBScript runs successfully when executed from SAS Base, but doesn't work in batch mode (I cannot see any errors).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;DATA _NULL_;&lt;BR /&gt;RC=SLEEP(5);&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;option noxwait;&lt;BR /&gt;option noxsync ;&lt;BR /&gt;data _NULL_;&lt;BR /&gt;rc1=system('path\copy_cal.vbs');&lt;BR /&gt;put rc1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;DATA _NULL_;&lt;BR /&gt;RC=SLEEP(5);&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 16:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VBScript-Executes-Successfully-in-SAS-Base-But-Fails-in-Batch/m-p/925031#M364078</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-04-19T16:19:13Z</dc:date>
    </item>
  </channel>
</rss>

