<?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: is RUN statement necessary? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688816#M209348</link>
    <description>&lt;P&gt;SAS added a run statement is this "ran without any problem".&lt;/P&gt;
&lt;P&gt;The last step (proc print here) would not run if not terminated by a run statement, as SAS has no way of knowing the step is finished and you want it to run.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Oct 2020 01:51:29 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-10-05T01:51:29Z</dc:date>
    <item>
      <title>is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688762#M209312</link>
      <description>&lt;P&gt;Hi Members,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS studio for learning and I submitted the below program and SAS run without any problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test1;
set sashelp.cars;
keep make model type origin;

data test2;
set sashelp.shoes;

proc print data=test2;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So my question is, what is the usefulness or &lt;SPAN&gt;necessity&amp;nbsp;&lt;/SPAN&gt;of the run statement when my program is able to run smoothly even with any run statements?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2020 15:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688762#M209312</guid>
      <dc:creator>marcuswong</dc:creator>
      <dc:date>2020-10-04T15:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688763#M209313</link>
      <description>&lt;P&gt;It is good programming practice. In some situations, a RUN; is required. Just because it isn't needed in this situation, it is needed in other situations. So get in the habit, you will avoid future problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But really, let's not debate this, it is good programming practice, so just do it for that reason. It is also good programming practice to place indentation in your code, as explained elsewhere in &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_self"&gt;Maxim 12&lt;/A&gt;. Just do it.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2020 15:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688763#M209313</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-04T15:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688767#M209319</link>
      <description>&lt;P&gt;Consider it good practice.&lt;/P&gt;
&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
set sashelp.class;
call symputx('count',_n_);

proc print data=class;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now, insert a %put for debugging:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
set sashelp.class;
call symputx('count',_n_);

%put &amp;amp;count.;

proc print data=class;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2020 15:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688767#M209319</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-04T15:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688775#M209323</link>
      <description>&lt;P&gt;The RUN statement let's SAS know when the code for the current step is finished (or for interactive procs when the current run group is finished.)&amp;nbsp; Without that SAS will have to figure out that you were done with the code for the current step.&amp;nbsp; It knows you are done when it either sees the start of the next step or the end of the file.&amp;nbsp; Note that SAS/Studio will add code after your code that will include a RUN statement so the last step will run even though your SAS session is still open.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a lot of ways you can confuse yourself about what your code means (you can't confuse the SAS compiler).&amp;nbsp; Being sure to explicitly include the RUN statement (or QUIT statement for procedures that need that) will make it so you don't get confused about which statements are part of which step.&amp;nbsp; Or in the case of macro statements (like %PUT and %LET) and global statements (like TITLE and FOOTNOTE) whether they are run between two steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2020 17:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688775#M209323</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-04T17:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688816#M209348</link>
      <description>&lt;P&gt;SAS added a run statement is this "ran without any problem".&lt;/P&gt;
&lt;P&gt;The last step (proc print here) would not run if not terminated by a run statement, as SAS has no way of knowing the step is finished and you want it to run.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 01:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688816#M209348</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-10-05T01:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688825#M209350</link>
      <description>&lt;P&gt;If a RUN or QUIT statement is not used at the end of a step, SAS assumes that the beginning of a new step implies the end of the previous step.&lt;/P&gt;&lt;P&gt;If a RUN or QUIT statement is not used at the end of the last step in a program, SAS Studio and SAS Enterprise Guide automatically submit a RUN and QUIT statement after the submitted code.&lt;/P&gt;&lt;P&gt;The RUN statement is &lt;STRONG&gt;not required&lt;/STRONG&gt; between steps in a SAS program. However, it is a best practice to use a RUN statement because it can make the SAS program easier to read and the SAS log easier to understand when debugging.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 05:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/688825#M209350</guid>
      <dc:creator>Dritan007</dc:creator>
      <dc:date>2020-10-05T05:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/689376#M209561</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/340566"&gt;@Dritan007&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to disable the auto run statement in SAS studio?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to convince myself that the last proc print step in the below program will not run:&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;data test1;
set sashelp.cars;
keep make model type origin;

data test2;
set sashelp.shoes;

proc print data=test2;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 23:47:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/689376#M209561</guid>
      <dc:creator>marcuswong</dc:creator>
      <dc:date>2020-10-06T23:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/689383#M209566</link>
      <description>There is an ICON on the code editor window named GO INTERACTIVE.&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Oct 2020 00:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/689383#M209566</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-07T00:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/689979#M209817</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp; I'm totally confused now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I login SAS studio, click go-interactive ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;write this one liner code: proc print data=sashelp.cars;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first click of running man no print results.&lt;/P&gt;&lt;P&gt;second click of running man there is print result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/689979#M209817</guid>
      <dc:creator>marcuswong</dc:creator>
      <dc:date>2020-10-08T13:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/689987#M209822</link>
      <description>&lt;P&gt;Sounds right to me.&amp;nbsp; So first you submitted:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=sashelp.cars;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So SAS is waiting for you to finish speaking before it gives you an answer.&lt;/P&gt;
&lt;P&gt;Then you submitted:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=sashelp.cars;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And now SAS sees the new PROC starting so it runs the first one.&amp;nbsp; And it is still waiting for you to finish the second proc.&lt;/P&gt;
&lt;P&gt;Try now submitting:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  var make model;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And see what you get. Compare it to the output of the first PROC PRINT.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/689987#M209822</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-08T14:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: is RUN statement necessary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/690469#M210057</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892" target="_blank"&gt;@PaigeMiller&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961" target="_blank"&gt;@ChrisNZ&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159" target="_blank"&gt;@Tom&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562" target="_blank"&gt;@KurtBremser&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/340566" target="_blank"&gt;@Dritan007&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for the guidance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 15:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-RUN-statement-necessary/m-p/690469#M210057</guid>
      <dc:creator>marcuswong</dc:creator>
      <dc:date>2020-10-09T15:42:56Z</dc:date>
    </item>
  </channel>
</rss>

