<?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 Trying to exit code in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-exit-code/m-p/793433#M81510</link>
    <description>&lt;P&gt;Hi there, I am trying to exit my code when the count is greater than 3 but i get the error:ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%include "C:/list.sas";
/*file paths*/
%let path_in= C:/FileCheck;
/*List of files*/
%list_files("C:/File",txt)

%let filecount = 0;

%if %sysfunc(exist(tables))
%then %do;

proc sql;
create table filecount as
select count(name) into: filecount 
from tables;
quit;
%end;

%if &amp;amp;filecount. &amp;gt;= 3 %then %do;
	%goto exitc;
%end;

%exitc:&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jan 2022 08:57:00 GMT</pubDate>
    <dc:creator>Citrine10</dc:creator>
    <dc:date>2022-01-31T08:57:00Z</dc:date>
    <item>
      <title>Trying to exit code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-exit-code/m-p/793433#M81510</link>
      <description>&lt;P&gt;Hi there, I am trying to exit my code when the count is greater than 3 but i get the error:ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%include "C:/list.sas";
/*file paths*/
%let path_in= C:/FileCheck;
/*List of files*/
%list_files("C:/File",txt)

%let filecount = 0;

%if %sysfunc(exist(tables))
%then %do;

proc sql;
create table filecount as
select count(name) into: filecount 
from tables;
quit;
%end;

%if &amp;amp;filecount. &amp;gt;= 3 %then %do;
	%goto exitc;
%end;

%exitc:&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 08:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-exit-code/m-p/793433#M81510</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2022-01-31T08:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to exit code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-exit-code/m-p/793440#M81511</link>
      <description>&lt;P&gt;The %goto command is only valid within a SAS macro and not as open code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just "wrap" a macro around your code and things should start to work.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 09:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-exit-code/m-p/793440#M81511</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-01-31T09:28:48Z</dc:date>
    </item>
  </channel>
</rss>

