<?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: batch powershell to SAS EG in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592152#M34775</link>
    <description>&lt;P&gt;This might not be the real solution, but have you tried launching your scripts in different processes?&amp;nbsp; Do they each work when run in succession from a command shell?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;startprocess powershell -argument "path\project1.ps1" -Wait
startprocess powershell -argument "path\project2.ps1" -Wait
startprocess powershell -argument "path\project3.ps1" -Wait
startprocess powershell -argument "path\project4.ps1" -Wait&lt;/PRE&gt;</description>
    <pubDate>Fri, 27 Sep 2019 13:37:57 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2019-09-27T13:37:57Z</dc:date>
    <item>
      <title>batch powershell to SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592108#M34766</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My goal is to launch a batch that launches several PowerShell scripts, each of which executes a SEG project.&lt;BR /&gt;My batch launches a PowerShell script, this PowerShell script launches several PowerShell scripts and each script runs a SEG project.&lt;BR /&gt;The first SEG project starts well and the others launch without really executing the body of the program which makes me logs of 10 KB and without error message on the execution of the program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the connection to SasApp is not done, yet I put phony codes to save some time for SasApp to connect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone to a solution or idea of the approach to follow it would be great&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 09:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592108#M34766</guid>
      <dc:creator>isek</dc:creator>
      <dc:date>2019-09-27T09:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: batch powershell to SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592136#M34772</link>
      <description>&lt;P&gt;Can you share an example of a simple script -- one that's not working the way you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One idea -- make sure that you Close / null out the Project and App objects you create during each script, so the process can clean up as much as possible between runs.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 11:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592136#M34772</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-09-27T11:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: batch powershell to SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592149#M34774</link>
      <description>&lt;P&gt;I have four scripts like project1.ps1, then in my batch runs the script Allproject1.ps1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;path\Allproject1.ps1 :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;path\project1.ps1&lt;BR /&gt;path\project2.ps1&lt;BR /&gt;path\project3.ps1&lt;BR /&gt;path\project4.ps1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;project1.ps1 :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$rep_init="C:\Windows"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;$rep_projet="$rep_init\......"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$rep_log="$rep_projet\Log"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;$eguideApp = New-Object -comObject SASEGObjectModel.Application.7.1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;############## project SAS&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;$projName = "$rep_projet\H_project1.egp"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$project = $eguideApp.Open("$projName", "")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$projectLog = $project.ProjectLog&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;# Show all of the process flows in the project&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$pfCollection = $project.ContainerCollection&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;###################### FLUX&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Write-Host "Clearing the project log in EG project: " $project&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;# Clear the project log:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$projectLog.Clear()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;# Other available project log operation examples...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;# Enable/disable project log:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$projectLog.Enabled = $true&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;# Get project log text:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$strProjectLog = $projectLog.Text&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Write-Host "Project log text: " $strProjectLog&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;$pf=$pfCollection.item("Flux de processus")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Write-Host " 1 - EXECUTION DU PREMIER FLUX DE PROCESSUS " $pf.Name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# To RUN a process flow, simply use $pf.Run()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$pf.Run()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;# Save project log to a file:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;$projectLog.SaveAs("$rep_log\Log_project1.txt")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;$project.Close()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;$eguideApp.Quit()&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 13:06:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592149#M34774</guid>
      <dc:creator>isek</dc:creator>
      <dc:date>2019-09-27T13:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: batch powershell to SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592152#M34775</link>
      <description>&lt;P&gt;This might not be the real solution, but have you tried launching your scripts in different processes?&amp;nbsp; Do they each work when run in succession from a command shell?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;startprocess powershell -argument "path\project1.ps1" -Wait
startprocess powershell -argument "path\project2.ps1" -Wait
startprocess powershell -argument "path\project3.ps1" -Wait
startprocess powershell -argument "path\project4.ps1" -Wait&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Sep 2019 13:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/batch-powershell-to-SAS-EG/m-p/592152#M34775</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-09-27T13:37:57Z</dc:date>
    </item>
  </channel>
</rss>

