<?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: Can you stack commands in an 'x' statement in Windows? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305413#M65144</link>
    <description>&lt;P&gt;While I wasn't able to find a solution to the original question, I found a way to get (mostly) the same thing done:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x " ""C:\Program Files\SASHome\SASFoundation\9.4\sas.exe"" -sysin ""&amp;amp;runpath\test1.sas"" -log ""&amp;amp;runpath\test1.log"" ";&lt;/P&gt;
&lt;P&gt;also works nicely for kicking off an external SAS run.&amp;nbsp; Coupling it with noxwait and noxsync then allows a controlling SAS sheduler to spawn off different SAS runs at will without getting held up waiting for each to complete.&amp;nbsp; This was the final goal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2016 15:14:47 GMT</pubDate>
    <dc:creator>BenConner</dc:creator>
    <dc:date>2016-10-18T15:14:47Z</dc:date>
    <item>
      <title>Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305204#M65070</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to be able to do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x 'p:^cd \sites\^spacechk.bat&amp;nbsp;&amp;gt;c:\sites.txt';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming the&amp;nbsp;^ character is a command separator.&amp;nbsp; Not sure if it is possible in Windows, much less easy.&amp;nbsp; Anyone done this before?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 19:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305204#M65070</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2016-10-17T19:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305209#M65072</link>
      <description>&lt;P&gt;You separate commands by &amp;amp; or &amp;amp;&amp;amp;, but each command has to correct.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test it on your OS first and then use it in SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 20:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305209#M65072</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-17T20:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305231#M65078</link>
      <description>&lt;P&gt;Oh, now that's slick.&amp;nbsp; Worked perfectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 20:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305231#M65078</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2016-10-17T20:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305249#M65083</link>
      <description>&lt;P&gt;On a related note, is there a way to mask an embedded blank in an argument to a batch file?&amp;nbsp; By default it will throw off the count of the # of arguments...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 21:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305249#M65083</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2016-10-17T21:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305252#M65086</link>
      <description>&lt;P&gt;Usually you use quotation marks? You can embded single quotes within double quotes or double quotes within single quotes as necessary.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 21:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305252#M65086</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-17T21:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305253#M65087</link>
      <description>&lt;P&gt;Doesn't seem to work in passing arguments in a .bat file.&amp;nbsp; Will Google it and see what I can find.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 21:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305253#M65087</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2016-10-17T21:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305257#M65090</link>
      <description>&lt;P&gt;You may have to show the content of the batch file.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 22:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305257#M65090</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-17T22:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305260#M65092</link>
      <description>&lt;P&gt;That's certainly not a problem.&amp;nbsp; I called it runsas.bat:&lt;/P&gt;
&lt;P&gt;echo Initiating run for %3.sas&lt;BR /&gt;echo 1=%~1&lt;BR /&gt;echo 2=%~2&lt;BR /&gt;echo 3=%~3&lt;BR /&gt;pause&lt;BR /&gt;%1&lt;BR /&gt;cd %2&lt;BR /&gt;copy lock %3.lck&lt;BR /&gt;"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -sysin "%3.sas" -memsize max&lt;BR /&gt;del %3.lck&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first 4 lines are for debugging and will go away.&amp;nbsp; The object was to run it from SAS with the X command.&amp;nbsp; Argument 1 is the drive letter; argument 2 is the path to the SAS program to be run; argument 3 is the name of the SAS source file w/o a suffix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The file 'lock' is a single character file used as a blocking semaphore.&amp;nbsp; Or will be when I get this working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the path can have embedded spaces in it, this has been causing me grief trying to get it right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 22:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305260#M65092</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2016-10-17T22:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can you stack commands in an 'x' statement in Windows?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305413#M65144</link>
      <description>&lt;P&gt;While I wasn't able to find a solution to the original question, I found a way to get (mostly) the same thing done:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x " ""C:\Program Files\SASHome\SASFoundation\9.4\sas.exe"" -sysin ""&amp;amp;runpath\test1.sas"" -log ""&amp;amp;runpath\test1.log"" ";&lt;/P&gt;
&lt;P&gt;also works nicely for kicking off an external SAS run.&amp;nbsp; Coupling it with noxwait and noxsync then allows a controlling SAS sheduler to spawn off different SAS runs at will without getting held up waiting for each to complete.&amp;nbsp; This was the final goal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-stack-commands-in-an-x-statement-in-Windows/m-p/305413#M65144</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2016-10-18T15:14:47Z</dc:date>
    </item>
  </channel>
</rss>

