<?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: DATA step ABORT statement causes errors on next SUBMIT operation in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/730782#M9912</link>
    <description>&lt;P&gt;Thanks for the info. I had the same issue to use %ABORT CANCEL statement as well. I recently got help from SAS instructor Allison Saito for a workaround solution which worked well - using below code can properly close the environment files and run other code again without '..file in use' error -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ......&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;FONT&gt; &amp;nbsp; &amp;nbsp;&amp;nbsp; ODS HTML CLOSE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS HTML5 (ID=WEB) CLOSE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS RTF (ID=WEB) CLOSE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS PDF (ID=WEB) CLOSE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;%ABORT CANCEL;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Apr 2021 16:56:49 GMT</pubDate>
    <dc:creator>snow2021</dc:creator>
    <dc:date>2021-04-01T16:56:49Z</dc:date>
    <item>
      <title>DATA step ABORT statement causes errors on next SUBMIT operation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/586868#M7916</link>
      <description>&lt;P&gt;I've searched the Problem Notes and the Conversations here in the SAS Studio community, but have not found a mention of the problem that I recently stumbled on.&amp;nbsp; In macro code submitted via SAS Studio 3.6 running on Windows 2012 R2 servers, the following DATA step was conditionally executed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; abort cancel nolist;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ABORT statement was processed as one would expect, with the normal error message:&lt;/P&gt;&lt;P&gt;ERROR: Execution terminated by an ABORT CANCEL statement at line x column y.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next time that a SUBMIT operation is performed, the following errors and warnings result.&lt;/P&gt;&lt;P&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;ERROR: At least one file associated with fileref _HTMLOUT is still in use.&lt;BR /&gt;ERROR: Error in the FILENAME statement.&lt;BR /&gt;ERROR: At least one file associated with fileref _RTFOUT is still in use.&lt;BR /&gt;ERROR: Error in the FILENAME statement.&lt;BR /&gt;WARNING: SASDATE value cannot be changed in mid document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The submitted code executes normally.&amp;nbsp; And apparently, the actions that were not taken after the ABORT statement was executed are successfully executed now, because subsequent SUBMIT operations do not encounter these errors.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are planning to recode our macro to avoid use of the ABORT statement, but it seems like there ought to be a Usage Note or Problem Note about this.&amp;nbsp; If there is, my searches failed to find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a known bug?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;dd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 20:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/586868#M7916</guid>
      <dc:creator>DDutton</dc:creator>
      <dc:date>2019-09-06T20:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: DATA step ABORT statement causes errors on next SUBMIT operation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/586894#M7917</link>
      <description>&lt;P&gt;The ABORT statement closes the SAS session your SAS Studio client has been using at that point so it probably bypasses some cleanup stuff that SAS Studio would normally do when closing a session. The next code submit would therefore need to trigger a brand-new SAS session where you would be starting from scratch and need to repeat any session setup stuff you need. I'm not surprised SAS Studio might have some difficulty "picking up the pieces".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure why you would want to use ABORT in this context. This statement's main use would be for batch jobs where you simply want to halt any further execution of statements. Perhaps if you explained your use case we might be able to suggest alternatives.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 22:08:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/586894#M7917</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-09-06T22:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: DATA step ABORT statement causes errors on next SUBMIT operation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/587291#M7922</link>
      <description>&lt;P&gt;Actually, the ABORT statement does NOT end the SAS Session when submitted within SAS Studio, or within SAS Enterprise Guide.&amp;nbsp; That would certainly be a bug&amp;nbsp;per the documentation:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ABORT statement CANCEL option doc:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CANCEL &amp;lt;FILE&amp;gt;&lt;/P&gt;&lt;DIV class="xis-argumentDescription"&gt;&lt;P class="xis-paraSimpleFirst"&gt;causes the execution of the submitted statements to be canceled. Actions depend on the method of operation.&lt;/P&gt;&lt;DIV class="xis-listUnordered"&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;batch mode and noninteractive mode&lt;/DIV&gt;&lt;DIV class="xis-listUnordered"&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;terminates the entire SAS program and SAS system.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;writes an error message to the SAS log.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;windowing environment and interactive line mode&lt;/DIV&gt;&lt;DIV class="xis-listUnordered"&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;clears only the current submitted program.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;does not affect other subsequent submitted programs.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;writes an error to the SAS log.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;workspace server and stored process server&lt;/DIV&gt;&lt;DIV class="xis-listUnordered"&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;clears only the currently submitted program.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;does not affect other subsequent submit calls.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;writes an error message to the SAS log.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV class="xis-item"&gt;&lt;UL&gt;&lt;LI&gt;SAS IntrNet application server&lt;UL&gt;&lt;LI&gt;creates a separate execution for each request and submits the request code. A CANCEL argument in the request code clears the current submitted code but does not terminate the execution or the SAS session.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try submitting this code in SAS Studio and observing the data sets in the WORK llibrary.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro abort_test;&lt;BR /&gt;data ;&lt;BR /&gt;x=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;abort cancel nolist;&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;%abort_test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll see that the data sets (DATA1, DATA2, etc.) created in each execution remain in the WORK library, showing that the SAS Session is not terminated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, in SAS Studio on code submitted after the submit with the ABORT statement, errors are generated regarding the filerefs and SASDATE value.&amp;nbsp; In Enterprise Guide, no such errors are encountered.&amp;nbsp; SAS Studio, like Enterprise Guide, should handle this statement gracefully, not issue error messages on the next SUBMIT operation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As to the purpose of the submitted DATA step with the ABORT statement - it was conditionally executed by the macro to end the currently running program which calls this macro.&amp;nbsp; Most of our programmers use either batch submit or SAS Enterprise Guide, so have not hit this problem.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="xis-argumentDescription"&gt;&lt;DIV class="xis-listUnordered"&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-listUnordered"&gt;&lt;DIV class="xis-item"&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;So my real point is not about what could I do instead of use the DATA step with the ABORT statement, but about the fact that I believe this is a bug in SAS Studio and should have a defect opened against it and a Usage Note/Problem Note about it.&amp;nbsp; Before pursuing the opening of a defect, I thought I would check in with this forum to see if anyone else had run into this, and if they knew of a SASNote about it, as I could not find one.&amp;nbsp; What do y'all think?&amp;nbsp; Bug to be reported? I think so.&lt;/DIV&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Sep 2019 16:02:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/587291#M7922</guid>
      <dc:creator>DDutton</dc:creator>
      <dc:date>2019-09-09T16:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: DATA step ABORT statement causes errors on next SUBMIT operation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/591301#M8007</link>
      <description>&lt;P&gt;In case any one is interested, Tech Support reports that this is a known bug fixed in SAS Studio 5.1, which runs on the SAS Viya Architecture.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 20:46:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/591301#M8007</guid>
      <dc:creator>DDutton</dc:creator>
      <dc:date>2019-09-24T20:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: DATA step ABORT statement causes errors on next SUBMIT operation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/730782#M9912</link>
      <description>&lt;P&gt;Thanks for the info. I had the same issue to use %ABORT CANCEL statement as well. I recently got help from SAS instructor Allison Saito for a workaround solution which worked well - using below code can properly close the environment files and run other code again without '..file in use' error -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ......&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;FONT&gt; &amp;nbsp; &amp;nbsp;&amp;nbsp; ODS HTML CLOSE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS HTML5 (ID=WEB) CLOSE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS RTF (ID=WEB) CLOSE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS PDF (ID=WEB) CLOSE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;%ABORT CANCEL;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 16:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/730782#M9912</guid>
      <dc:creator>snow2021</dc:creator>
      <dc:date>2021-04-01T16:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: DATA step ABORT statement causes errors on next SUBMIT operation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/961583#M11392</link>
      <description>Really appreciate this workaround. Not sure when or if we will upgrade to Viya, so I would be stuck with this bug in Studio. Thanks again.</description>
      <pubDate>Tue, 11 Mar 2025 16:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/DATA-step-ABORT-statement-causes-errors-on-next-SUBMIT-operation/m-p/961583#M11392</guid>
      <dc:creator>JaySC</dc:creator>
      <dc:date>2025-03-11T16:11:20Z</dc:date>
    </item>
  </channel>
</rss>

