<?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: Add a check point to the entire procedure in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407531#M67067</link>
    <description>&lt;P&gt;You&amp;nbsp; can use the DICTIONARY feature of proc sql, specifically&amp;nbsp;dictionary.tables.&amp;nbsp; Lets say you want to examine all datasets whose name begins with 'X' in the work library:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  select 
    case when min(nobs)&amp;gt;0 then 'CONTINUE' else 'STOP' end
  into :status
  from dictionary.tables 
  where libname='WORK' and memname like 'X%';
quit;
%put &amp;amp;=status;
%if &amp;amp;status=CONTINUE %then %do;
   ...
   ...
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 26 Oct 2017 03:53:44 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2017-10-26T03:53:44Z</dc:date>
    <item>
      <title>Add a check point to the entire procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407337#M67047</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question on setting a check point within the SAS code. This check point could decide if later procedures will run or stop.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code has 10 input tables: Table1, Table2, ..., Table10.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Later procedures will run if Table1 through Table10 they all have observations (not empty). Later procedure will stop if any one&amp;nbsp;of Table1 through Table10 is empty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know the following code could check whether the table is empty or not for 1 table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;        Proc Sql noprint;
			Select * from Table1;
	Quit;

	put *&amp;amp;sqlobs*;

	if &amp;amp;sqlobs &amp;gt; 0 
		then do; 
                        ...
        else do;
                end; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How could I apply similar procedure to 10 tables? Is there any simple way?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 15:36:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407337#M67047</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2017-10-25T15:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add a check point to the entire procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407531#M67067</link>
      <description>&lt;P&gt;You&amp;nbsp; can use the DICTIONARY feature of proc sql, specifically&amp;nbsp;dictionary.tables.&amp;nbsp; Lets say you want to examine all datasets whose name begins with 'X' in the work library:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  select 
    case when min(nobs)&amp;gt;0 then 'CONTINUE' else 'STOP' end
  into :status
  from dictionary.tables 
  where libname='WORK' and memname like 'X%';
quit;
%put &amp;amp;=status;
%if &amp;amp;status=CONTINUE %then %do;
   ...
   ...
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Oct 2017 03:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407531#M67067</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-10-26T03:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add a check point to the entire procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407814#M67093</link>
      <description>&lt;P&gt;Great, thank you!&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 20:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407814#M67093</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2017-10-26T20:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Add a check point to the entire procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407919#M67096</link>
      <description>&lt;P&gt;With this method, you have to encase the whole program in a macro for %if statements to be accepted, and you end up with 10 nested tests (unless you use %goto).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's a sad limitation of SAS's that one has to resort to such kludges.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/Create-new-statement-STOPROGRAMRIGHTHERE-or-similar/idi-p/332062" target="_self"&gt;here&lt;/A&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 05:05:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-check-point-to-the-entire-procedure/m-p/407919#M67096</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-10-27T05:05:01Z</dc:date>
    </item>
  </channel>
</rss>

