<?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: Endsas does not cause DI Studio to exit: is it the expected behaviour? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844967#M20628</link>
    <description>&lt;P&gt;ENDSAS or constructs like ABORT ABEND are&amp;nbsp;&lt;STRONG&gt;not advisable&lt;/STRONG&gt; when run from client applications like EG or DI Studio or SAS Studio -- because they terminate the SAS session, dispose of all temporary results, and deny the client application any opportunity to retrieve any in-process ODS results and other artifacts. It's like hanging up the phone in the middle of a conversation, but the receiving party has no idea why...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is useful in batch and perhaps interactive &lt;STRONG&gt;local&lt;/STRONG&gt; SAS, where you want the SAS session to end and stop consuming resources...and you have access to the artifacts that might have been created thus far (including a log file).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If using the same program in batch and in a client like EG, conditional logic can be used to avoid the ENDSAS path in one environment but allow it in the other.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2022 20:30:37 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2022-11-17T20:30:37Z</dc:date>
    <item>
      <title>Endsas does not cause DI Studio to exit: is it the expected behaviour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844814#M20621</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I've been playing a bit with the endsas statement, which according to the SAS documentation (&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p1aok1r21bw4oqn17duao6d81m2l.htm)" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p1aok1r21bw4oqn17duao6d81m2l.htm)&lt;/A&gt;&amp;nbsp;[without arguments] "terminates a SAS session as soon as it is encountered in a DATA step or a PROC step. ENDSAS terminates the entire SAS session and not just the SAS job.".&lt;/P&gt;
&lt;P&gt;If I type endsas in a SAS windowing environment the application exits, but if I use endsas as part of the precode to a transformation in a SAS job in SAS DI Studio, the job stops but DI Studio remains active.&lt;/P&gt;
&lt;P&gt;Based on the documentation, I actually expected DI Studio to close (as is the case with the SAS windowing environment). Am I missing something?&lt;/P&gt;
&lt;P&gt;TIA&lt;/P&gt;
&lt;P&gt;Anne.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 12:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844814#M20621</guid>
      <dc:creator>Anne_A</dc:creator>
      <dc:date>2022-11-17T12:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Endsas does not cause DI Studio to exit: is it the expected behaviour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844856#M20623</link>
      <description>&lt;P&gt;In general, you should not use the ENDSAS statement when you are running SAS from any interface: SAS Studio, DI Studio, Visual Analytics, etc. The ENDSAS statement is used in command-line mode (a console window) to terminate a SAS session and return control to the shell.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 13:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844856#M20623</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-11-17T13:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Endsas does not cause DI Studio to exit: is it the expected behaviour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844857#M20624</link>
      <description>&lt;P&gt;DI Studio works in a bit diffrent way than Base SAS windowing environment. DI Studio is a Java application, and when using the main windows, wizards etc it interacts with the Metadata Server.&lt;/P&gt;
&lt;P&gt;When you execute your jobs in DI Studio, you create a server side SAS session through a mechanism called Workspace Server. This SAS session will terminate when it encounters the ENDSAS statement. The DI Studio interface is not dependant on the status of your submitted SAS code.&lt;/P&gt;
&lt;P&gt;DI Studio is a developer tool, not a tool for production execution of code.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 08:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844857#M20624</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-11-18T08:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Endsas does not cause DI Studio to exit: is it the expected behaviour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844869#M20625</link>
      <description>Crystal clear, thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;.</description>
      <pubDate>Thu, 17 Nov 2022 14:24:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844869#M20625</guid>
      <dc:creator>Anne_A</dc:creator>
      <dc:date>2022-11-17T14:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Endsas does not cause DI Studio to exit: is it the expected behaviour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844875#M20626</link>
      <description>Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;,&lt;BR /&gt;That makes perfect sense. DI Studio is not technically an interactive SAS session (documentation cited above mentions "ENDSAS is most useful in interactive or windowing sessions.").&lt;BR /&gt;Cheers.</description>
      <pubDate>Thu, 17 Nov 2022 14:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844875#M20626</guid>
      <dc:creator>Anne_A</dc:creator>
      <dc:date>2022-11-17T14:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Endsas does not cause DI Studio to exit: is it the expected behaviour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844956#M20627</link>
      <description>&lt;P&gt;&lt;A class="trigger-hovercard" style="color: #339900;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684" target="_blank"&gt;Rick_SAS&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;While ENDSAS was originally designed to be used in command-line mode, it is perfectly fine to use it in any SAS interface, but it is especially useful in SAS programs that run in batch mode. One can (interactively) run a selected portion of code in SAS interface, but in batch we don't have that luxury, while often need to stop/terminate SAS process/session when a certain condition occurs (for example, a source file does not exist). That is where ENDSAS global statement comes very handy. I describe such usage in the following blog posts:&lt;/P&gt;
&lt;H1 class="post-title item fn"&gt;&lt;A href="https://blogs.sas.com/content/sgf/2021/03/24/how-to-conditionally-stop-sas-code-execution-and-gracefully-terminate-sas-session/" target="_self"&gt;&lt;FONT size="4"&gt;How to conditionally stop SAS code execution and gracefully terminate SAS session&lt;/FONT&gt;&lt;/A&gt;&lt;/H1&gt;
&lt;P&gt;&lt;FONT size="4"&gt;and&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2022/10/18/adaptive-sas-programming-for-the-software-development-life-cycle/" target="_self"&gt;&lt;FONT size="4"&gt;Adaptive SAS programming for the Software Development Life Cycle&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;NOTE: In &lt;A href="https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289392.htm" target="_self"&gt;some SAS docs&lt;/A&gt;, it is incorrectly stated that "ENDSAS is most useful in interactive or windowing sessions."&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 19:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844956#M20627</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2022-11-17T19:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Endsas does not cause DI Studio to exit: is it the expected behaviour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844967#M20628</link>
      <description>&lt;P&gt;ENDSAS or constructs like ABORT ABEND are&amp;nbsp;&lt;STRONG&gt;not advisable&lt;/STRONG&gt; when run from client applications like EG or DI Studio or SAS Studio -- because they terminate the SAS session, dispose of all temporary results, and deny the client application any opportunity to retrieve any in-process ODS results and other artifacts. It's like hanging up the phone in the middle of a conversation, but the receiving party has no idea why...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is useful in batch and perhaps interactive &lt;STRONG&gt;local&lt;/STRONG&gt; SAS, where you want the SAS session to end and stop consuming resources...and you have access to the artifacts that might have been created thus far (including a log file).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If using the same program in batch and in a client like EG, conditional logic can be used to avoid the ENDSAS path in one environment but allow it in the other.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 20:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Endsas-does-not-cause-DI-Studio-to-exit-is-it-the-expected/m-p/844967#M20628</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-11-17T20:30:37Z</dc:date>
    </item>
  </channel>
</rss>

