<?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: Error : Running SASEG project  with powershell in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/567320#M34023</link>
    <description>&lt;P&gt;Make sure that you're running the scripting engine (PowerShell or VBScript) that matches the bitness of the EG you have.&amp;nbsp; If running 32-bit EG, then you need the 32-bit cscript.exe or powershell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have &lt;A href="https://blogs.sas.com/content/sasdummy/2011/05/03/using-sas-enterprise-guide-to-run-programs-in-batch/" target="_self"&gt;a note about this in this blog post&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2019 15:25:48 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2019-06-19T15:25:48Z</dc:date>
    <item>
      <title>Error : Running SASEG project  with powershell</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/567290#M34022</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I want to run an automated lock project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;First solution :&lt;/U&gt;&lt;BR /&gt;I tried to do it via the scheduler sas EG, it returns me an error to the execution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;second solution :&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;I coded a powershell script that launches my project, I have a problem with the launch of sasEG.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;script in my cmd.exe&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;powershell New-Object -ComObject SASEGObjectModel.Application.7.1 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Did anyone have the same problem as me? Does anyone have a solution to offer me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it's a problem of version but I do not know how to proceed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 14:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/567290#M34022</guid>
      <dc:creator>isek</dc:creator>
      <dc:date>2019-06-19T14:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error : Running SASEG project  with powershell</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/567320#M34023</link>
      <description>&lt;P&gt;Make sure that you're running the scripting engine (PowerShell or VBScript) that matches the bitness of the EG you have.&amp;nbsp; If running 32-bit EG, then you need the 32-bit cscript.exe or powershell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have &lt;A href="https://blogs.sas.com/content/sasdummy/2011/05/03/using-sas-enterprise-guide-to-run-programs-in-batch/" target="_self"&gt;a note about this in this blog post&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 15:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/567320#M34023</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-06-19T15:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error : Running SASEG project  with powershell</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/568012#M34050</link>
      <description>thank you for your reply.&lt;BR /&gt;I have a second problem which is that I have two versions of Sas guide one in 4.3 and one in 7.1 so can this also be a problem when I run on version 7.1?&lt;BR /&gt;Thank you for your time</description>
      <pubDate>Fri, 21 Jun 2019 17:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/568012#M34050</guid>
      <dc:creator>isek</dc:creator>
      <dc:date>2019-06-21T17:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error : Running SASEG project  with powershell</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/568723#M34055</link>
      <description>&lt;P&gt;The scripting engine has a version-specific object ID.&amp;nbsp; V7.1 can be either 32- or 64-bit, so you have to verify which you have and then use the proper version of PowerShell.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 12:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/568723#M34055</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-06-25T12:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error : Running SASEG project  with powershell</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/818053#M40848</link>
      <description>&lt;P&gt;Is there a way to retrieve the error in powershell ?&lt;BR /&gt;&lt;BR /&gt;This is an example of my powershell script:&lt;/P&gt;&lt;P&gt;$sas = New-Object -comObject SASEGObjectModel.Application.7.1&lt;/P&gt;&lt;P&gt;$App=$sas.Open("C:\temp\myTestFile.egp","")&lt;/P&gt;&lt;P&gt;Foreach($parametre in $App.Parameters)&lt;BR /&gt;{&lt;BR /&gt;If ($parametre.Name -eq "USER")&lt;BR /&gt;{&lt;BR /&gt;$parametre.Value='MyUser'&lt;BR /&gt;}&lt;BR /&gt;If ($parametre.Name -eq "PASSWORD")&lt;BR /&gt;{&lt;BR /&gt;$parametre.Value='{sas002}MyPasswordEncrypted'&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Try {&lt;BR /&gt;$output = $App.run() #&amp;lt;======= How can I get the error here ???&lt;BR /&gt;Write-Host "Result: " $output}&lt;BR /&gt;Catch{&lt;BR /&gt;Write-Host "An error occurred:"&lt;BR /&gt;Write-Host $_&lt;BR /&gt;}&lt;BR /&gt;Finally{&lt;BR /&gt;$App.save()&lt;BR /&gt;$App.close()&lt;BR /&gt;$sas.quit()&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;In my sas macro, I simulate an error by inserting the same row 2 times so I want this error reported in the powershell script&lt;BR /&gt;proc sql;&lt;BR /&gt;insert into MyConnection.MyTable select * from to_insert;&lt;BR /&gt;%if &amp;amp;SQLRC &amp;gt; 0 %then %do;&lt;BR /&gt;%put ERROR: Error happened!;&lt;BR /&gt;%abort ABEND;&lt;BR /&gt;%end;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 11:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/818053#M40848</guid>
      <dc:creator>MarcoRQ</dc:creator>
      <dc:date>2022-06-14T11:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error : Running SASEG project  with powershell</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/818060#M40850</link>
      <description>&lt;P&gt;To get the SAS log, you will need to use the automation object model to navigate the project and retrieve the log objects from each task to find the error. &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Doing-More-with-SAS-Enterprise-Guide-Automation/ta-p/417832" target="_self"&gt;There are some examples here in VBScript&lt;/A&gt; that you can look at for ideas.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 12:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Running-SASEG-project-with-powershell/m-p/818060#M40850</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-06-14T12:06:45Z</dc:date>
    </item>
  </channel>
</rss>

