<?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: Using PowerShell as wrapper to launch SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60392#M13086</link>
    <description>We are wondering if we can launch and run program in Enterprise Guide 4.2 with powershell? I can launch the program with powershell but can not "run" the programs within it.&lt;BR /&gt;
&lt;BR /&gt;
As far as running SAS I found the following at&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www.eggheadcafe.com/software/aspnet/32285102/questions-on-powershell.aspx" target="_blank"&gt;http://www.eggheadcafe.com/software/aspnet/32285102/questions-on-powershell.aspx&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
It works with SAS files, but I can not get it to work with Enterprise Guide&lt;BR /&gt;
&lt;BR /&gt;
Start-Transcript -path 'C:\sas_works\joblog.txt'&lt;BR /&gt;
$ErrorActionPreference="Continue"&lt;BR /&gt;
Set-Location 'C:\program files\SAS\SAS 9.1'&lt;BR /&gt;
.\sas.exe 'C:\sas_works\PGM1.sas'|Out-Null&lt;BR /&gt;
$error=@($LastExitCode)&lt;BR /&gt;
$error&lt;BR /&gt;
if($error -ne 0)&lt;BR /&gt;
{ "ERROR! Please recheck the SAS code.Thank You."&lt;BR /&gt;
Stop-Transcript&lt;BR /&gt;
Exit&lt;BR /&gt;
}&lt;BR /&gt;
else&lt;BR /&gt;
{&lt;BR /&gt;
Cat "C:\sas_works\location.txt" &amp;gt; "D:\location.txt"&lt;BR /&gt;
Set-Location 'C:\sas_works'&lt;BR /&gt;
Stop-Transcript&lt;BR /&gt;
Exit&lt;BR /&gt;
}&lt;BR /&gt;
Exit</description>
    <pubDate>Thu, 26 Aug 2010 18:40:05 GMT</pubDate>
    <dc:creator>victorbarrow</dc:creator>
    <dc:date>2010-08-26T18:40:05Z</dc:date>
    <item>
      <title>Using PowerShell as wrapper to launch SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60389#M13083</link>
      <description>I have a number of data loads, reports etc that I process on a SAS windows server.  I currently use .bat files to launch sas.exe and run the SAS program.  I'd like to switch to Powershell scripts.&lt;BR /&gt;
&lt;BR /&gt;
Has anyone had any experience using PowerShell to launch SAS.  I'm particularly interested in passing condition codes from the SAS program back thru PowerShell to my scheduler (autosys) - want to only run job 2 if job 1 completed successfully.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in Advance</description>
      <pubDate>Wed, 04 Aug 2010 17:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60389#M13083</guid>
      <dc:creator>artmorlock</dc:creator>
      <dc:date>2010-08-04T17:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using PowerShell as wrapper to launch SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60390#M13084</link>
      <description>After searching these forums and the SAS support website, I found limited information on this topic/post.  You may want to consider contacting SAS tech support directly for their input/guidance, as well as reviewing the available tech/conference references using an Internet search (and searching the forums).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 04 Aug 2010 18:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60390#M13084</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-04T18:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using PowerShell as wrapper to launch SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60391#M13085</link>
      <description>Thanks Scott,&lt;BR /&gt;
I had opened a support ticket with SAS and they suggested I post the question in the forum. I'll experiment some and post my findings.</description>
      <pubDate>Thu, 12 Aug 2010 21:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60391#M13085</guid>
      <dc:creator>artmorlock</dc:creator>
      <dc:date>2010-08-12T21:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using PowerShell as wrapper to launch SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60392#M13086</link>
      <description>We are wondering if we can launch and run program in Enterprise Guide 4.2 with powershell? I can launch the program with powershell but can not "run" the programs within it.&lt;BR /&gt;
&lt;BR /&gt;
As far as running SAS I found the following at&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www.eggheadcafe.com/software/aspnet/32285102/questions-on-powershell.aspx" target="_blank"&gt;http://www.eggheadcafe.com/software/aspnet/32285102/questions-on-powershell.aspx&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
It works with SAS files, but I can not get it to work with Enterprise Guide&lt;BR /&gt;
&lt;BR /&gt;
Start-Transcript -path 'C:\sas_works\joblog.txt'&lt;BR /&gt;
$ErrorActionPreference="Continue"&lt;BR /&gt;
Set-Location 'C:\program files\SAS\SAS 9.1'&lt;BR /&gt;
.\sas.exe 'C:\sas_works\PGM1.sas'|Out-Null&lt;BR /&gt;
$error=@($LastExitCode)&lt;BR /&gt;
$error&lt;BR /&gt;
if($error -ne 0)&lt;BR /&gt;
{ "ERROR! Please recheck the SAS code.Thank You."&lt;BR /&gt;
Stop-Transcript&lt;BR /&gt;
Exit&lt;BR /&gt;
}&lt;BR /&gt;
else&lt;BR /&gt;
{&lt;BR /&gt;
Cat "C:\sas_works\location.txt" &amp;gt; "D:\location.txt"&lt;BR /&gt;
Set-Location 'C:\sas_works'&lt;BR /&gt;
Stop-Transcript&lt;BR /&gt;
Exit&lt;BR /&gt;
}&lt;BR /&gt;
Exit</description>
      <pubDate>Thu, 26 Aug 2010 18:40:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-PowerShell-as-wrapper-to-launch-SAS/m-p/60392#M13086</guid>
      <dc:creator>victorbarrow</dc:creator>
      <dc:date>2010-08-26T18:40:05Z</dc:date>
    </item>
  </channel>
</rss>

