<?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: How do I terminate a  SAS EG session via code? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848465#M41835</link>
    <description>&lt;P&gt;Another means is to use RPA to handle it. There are loads of RPA tools on the market. I like UiPath but Power Automate (free) can handle it too. See if Chris' idea works for your needs but look at RPA in case it doesn't. I use RPA a lot now (outside of SAS) and it simulates a person at a keyboard.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 04:58:20 GMT</pubDate>
    <dc:creator>AlanC</dc:creator>
    <dc:date>2022-12-08T04:58:20Z</dc:date>
    <item>
      <title>How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848262#M41829</link>
      <description>&lt;P&gt;How do I terminate a SAS EG session via code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two process flows. The first flow has a check file criteria on whether a file exists and if that file does not exist, the SAS EG session should end and the next process flow should not run.&lt;/P&gt;
&lt;P&gt;The code to check if the file exists is done but I can't seem to exit the EG session when the file is not found. I tried using endsas, abort exit but the second process flow still runs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I go about that?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 02:30:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848262#M41829</guid>
      <dc:creator>antenga</dc:creator>
      <dc:date>2022-12-07T02:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848444#M41830</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/80391"&gt;@antenga&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ENDSAS and ABORT EXIT will terminate the SAS session that EG connects to, but these won't close the EG application itself. There is no method in the EG user interface to say "if&amp;nbsp;&lt;EM&gt;this&lt;/EM&gt; happens, then close EG".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, EG does have a scripting interface. This is covered in this article with some simple script examples:&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Doing More with SAS Enterprise Guide Automation" uid="417832" url="https://communities.sas.com/t5/SAS-Communities-Library/Doing-More-with-SAS-Enterprise-Guide-Automation/m-p/417832#U417832" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The scripting interface requires a bit of code in VB Script or PowerShell or similar, and it's a way of running EG like a batch process and not an interactive user interface. Take a look at the examples and see if they help. If you need more help coming up with a script for your case, let me know.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 01:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848444#M41830</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-12-08T01:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848446#M41831</link>
      <description>&lt;P&gt;I created a process flow with two connected program tasks, the first of which just contained - ENDSAS; When I ran it the first one errored as it closed the SAS server session and the second one was cancelled. EG remained open. As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;says there is no way to programmatically close EG, but you can close the SAS server session within EG.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 01:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848446#M41831</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-08T01:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848449#M41832</link>
      <description>Hi,&lt;BR /&gt;I did use the ENDSAS and on the log it says 'Error: The connection to the server has been lost' but it still runs the next flow.&lt;BR /&gt;Rgds.</description>
      <pubDate>Thu, 08 Dec 2022 02:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848449#M41832</guid>
      <dc:creator>antenga</dc:creator>
      <dc:date>2022-12-08T02:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848452#M41833</link>
      <description>&lt;P&gt;Maybe your Code Submission option is different. This is mine on the ENDSAS program:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASKiwi_0-1670467234331.png" style="width: 296px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78177i85DC1C3A71851859/image-dimensions/296x280?v=v2" width="296" height="280" role="button" title="SASKiwi_0-1670467234331.png" alt="SASKiwi_0-1670467234331.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 02:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848452#M41833</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-08T02:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848457#M41834</link>
      <description>&lt;P&gt;If the goal is to skip the next flow only...not necessarily close EG...then &lt;A href="https://go.documentation.sas.com/doc/en/egcdc/8.3/egdoccdc/egug/p13s5c5jc3zgo3n18q122ixerw9v.htm#n1t3qujob5lg66n1oa96vhk2mndh" target="_self"&gt;use a Conditional Node at the start of your next flow branch&lt;/A&gt;. You can check for a condition like presence of a macro variable or an error code...whatever makes sense. If the condition isn't met then the flow will not run.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 03:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848457#M41834</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-12-08T03:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848465#M41835</link>
      <description>&lt;P&gt;Another means is to use RPA to handle it. There are loads of RPA tools on the market. I like UiPath but Power Automate (free) can handle it too. See if Chris' idea works for your needs but look at RPA in case it doesn't. I use RPA a lot now (outside of SAS) and it simulates a person at a keyboard.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 04:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848465#M41835</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2022-12-08T04:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848467#M41836</link>
      <description>&lt;P&gt;My setting is the same. Not sure why it did not work.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 05:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848467#M41836</guid>
      <dc:creator>antenga</dc:creator>
      <dc:date>2022-12-08T05:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848609#M41837</link>
      <description>&lt;P&gt;Try customising your submission options like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASKiwi_0-1670525781795.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78201i5EAF1884D15F81D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASKiwi_0-1670525781795.png" alt="SASKiwi_0-1670525781795.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 18:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/848609#M41837</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-08T18:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I terminate a  SAS EG session via code?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/849020#M41849</link>
      <description>Hi SasKiwi,&lt;BR /&gt;&lt;BR /&gt;I tried this setting  and it works as when the program ends, the query after it on the same flow and the next flow stops.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
      <pubDate>Sun, 11 Dec 2022 23:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-terminate-a-SAS-EG-session-via-code/m-p/849020#M41849</guid>
      <dc:creator>antenga</dc:creator>
      <dc:date>2022-12-11T23:32:44Z</dc:date>
    </item>
  </channel>
</rss>

