<?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: alternative of ENDSAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405595#M98696</link>
    <description>&lt;P&gt;I'm confused.&amp;nbsp; What was wrong with the original solution of abort cancel?&amp;nbsp; In interactive SAS, I think it does just what you're looking for.&amp;nbsp; AFAIK, it's the "best" way to stop a submission in interactive SAS, without ending the SAS session.&amp;nbsp; It's even better than syntax check mode, since it prevents all code form being executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
  x=1;
run;

/* need something here without quitting SAS session*/
data _null_;
  abort cancel;
run;

*don't want data b;
data b;
  x=3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Returns:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    data a;
2      x=1;
3    run;

NOTE: The data set WORK.A has 1 observations and 1 variables.

4
5    /* need something here without quiting SAS session*/
6    data _null_;
7      abort cancel;
8    run;

ERROR: Execution terminated by an ABORT CANCEL statement at line 7 column 3.
_ERROR_=1 _N_=1
NOTE: The SAS System stopped processing due to receiving a CANCEL request.
&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 Oct 2017 15:15:12 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2017-10-19T15:15:12Z</dc:date>
    <item>
      <title>alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404980#M98470</link>
      <description>&lt;P&gt;Hello all;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;I run SAS on PC;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want an alternative SAS code of 'ENDSAS' that will stop running the rest of SAS code without quit SAS session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data a;
x=1;
run;

endsas;/* need something here without quiting SAS session*/

*don't want data b;
data b;
x=3;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 19:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404980#M98470</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-10-17T19:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404986#M98471</link>
      <description>&lt;P&gt;Look at the ABORT statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ABORT CANCEL; seems to be what you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but maybe one of the other options will work better for you.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 19:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404986#M98471</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-10-17T19:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404989#M98472</link>
      <description>&lt;PRE&gt;data a;
x=1;
run;

/*

data b;
x=3;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;STRIKE&gt;this works but is a comment like method.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DOUBLE checked, this not work!!!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;after /* if there are some macros or other comments /**/... some of the program code will still be executed.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put in bold,this will alert me that will cause error and&amp;nbsp;almost it can't be&amp;nbsp;recognized .&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 21:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404989#M98472</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-10-17T21:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404991#M98473</link>
      <description>&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but :ERROR 180-322: Statement is not valid or it is used out of&lt;BR /&gt; proper order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 19:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404991#M98473</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-10-17T19:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404995#M98476</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10531"&gt;@GeorgeSAS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but :ERROR 180-322: Statement is not valid or it is used out of&lt;BR /&gt; proper order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Perhaps you could show us the relevant portion of the SASLOG so we might be able to figure out what went wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 19:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/404995#M98476</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-10-17T19:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405003#M98480</link>
      <description>37   data a;&lt;BR /&gt;38   x=1;&lt;BR /&gt;39   run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The data set WORK.A has 1 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;      real time           0.00 seconds&lt;BR /&gt;      cpu time            0.01 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;40&lt;BR /&gt;41   abort;&lt;BR /&gt;     -----&lt;BR /&gt;     180&lt;BR /&gt;&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of&lt;BR /&gt;               proper order.&lt;BR /&gt;&lt;BR /&gt;42&lt;BR /&gt;43   data b;&lt;BR /&gt;44   x=3;&lt;BR /&gt;45   run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The data set WORK.B has 1 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;      real time           0.00 seconds&lt;BR /&gt;      cpu time            0.01 seconds&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Oct 2017 20:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405003#M98480</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-10-17T20:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405007#M98484</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10531"&gt;@GeorgeSAS&lt;/a&gt;&amp;nbsp;What are you trying to achieve here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If something errors out, that the process stops or if you want the program to stop at a location, why have the rest of the code in the first place. I'm not understanding the business/process requirements here.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 20:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405007#M98484</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-17T20:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405008#M98485</link>
      <description>&lt;PRE&gt;data a;
x=1;
abort cancel;
run;&lt;/PRE&gt;
&lt;P&gt;But this is such a trivial example as to be meaningless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Normally, you'd want to abort if some variable takes on a value that it shouldn't have, where you stop execution of the code if the variable has such a value, and you continue to execute the code when the variable takes on values that are allowed. There are examples in the &lt;A href="http://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=p0hp2evpgqvfsfn1u223hh9ubv3g.htm&amp;amp;locale=en" target="_self"&gt;documentation&lt;/A&gt; of using ABORT this way. Is that what you want?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 20:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405008#M98485</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-10-17T20:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405038#M98493</link>
      <description>&lt;PRE&gt;DATA A;
X=1;
RUN;
%MACRO A;
DATA B;
X=2;
RUN;
%MEND;&lt;/PRE&gt;
&lt;P&gt;In batch mode 'endsas' works well, but in PC &amp;nbsp;interactive mode,I know we can use macro. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you Reeza!&lt;/P&gt;
&lt;P&gt;The reason I need this methods is I am working on developing stage,some code &amp;nbsp;I don't want them to be run currently but will run them in the future.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 21:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405038#M98493</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-10-17T21:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405104#M98516</link>
      <description>&lt;P&gt;That's an obvious gap in the SAS language, and an age-old request.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this &lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/Create-new-statement-STOPROGRAMRIGHTHERE-or-similar/idi-p/332062" target="_self"&gt;page&lt;/A&gt;&amp;nbsp;to vote for such a statement (but don't hold your breath) and to find a link to a workaround.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 04:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405104#M98516</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-10-18T04:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405267#M98570</link>
      <description>&lt;P&gt;I think in most case&amp;nbsp;base-SAS run in different platforms at the same time ,try not to create a new statement will reduce the confuse of people.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;write a little bit more code(macro) will solve the problem. safely and confidently&amp;nbsp;not mess/screw up the program.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:16:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405267#M98570</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-10-18T16:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: alternative of ENDSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405595#M98696</link>
      <description>&lt;P&gt;I'm confused.&amp;nbsp; What was wrong with the original solution of abort cancel?&amp;nbsp; In interactive SAS, I think it does just what you're looking for.&amp;nbsp; AFAIK, it's the "best" way to stop a submission in interactive SAS, without ending the SAS session.&amp;nbsp; It's even better than syntax check mode, since it prevents all code form being executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
  x=1;
run;

/* need something here without quitting SAS session*/
data _null_;
  abort cancel;
run;

*don't want data b;
data b;
  x=3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Returns:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    data a;
2      x=1;
3    run;

NOTE: The data set WORK.A has 1 observations and 1 variables.

4
5    /* need something here without quiting SAS session*/
6    data _null_;
7      abort cancel;
8    run;

ERROR: Execution terminated by an ABORT CANCEL statement at line 7 column 3.
_ERROR_=1 _N_=1
NOTE: The SAS System stopped processing due to receiving a CANCEL request.
&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Oct 2017 15:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/alternative-of-ENDSAS/m-p/405595#M98696</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2017-10-19T15:15:12Z</dc:date>
    </item>
  </channel>
</rss>

