<?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: Why use QUIT; with proc SQL? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/826809#M326587</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28909"&gt;@AllanBowe&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see only one good reason to `quit;` and that is if you want to control the timing statistics.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is the exact reason why I always QUIT. I want to see the stats of every single operation in SQL. Especially helpful when debugging/optimizing from the logs of batch jobs.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 08:57:06 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-08-03T08:57:06Z</dc:date>
    <item>
      <title>Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97992#M20675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data steps and most SAS procedures require many statements terminated by a RUN; before they can run. Proc SQL is different. Every statement is complete and can be executed immediately, without knowing what follows. So I wonder, what is the role of the QUIT; statement? Does it ever make a difference, besides writing the true running time to the log?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never use to bother with the QUIT; statement. Now I tend to use it for neatness and for avoiding being scolded. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; But the question remains: is it ever necessary?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2012 00:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97992#M20675</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-19T00:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97993#M20676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PG: Of course you are referring to your request for help regarding &lt;A _jive_internal="true" href="https://communities.sas.com/message/135639#135639"&gt;https://communities.sas.com/message/135639#135639&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In responding, I ran your code and got the same error that the OP mentioned.&amp;nbsp; I looked at your code and couldn't find anything wrong, other than my own preference to end all procs and steps with either quit;, run;, or both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added quit; statements to the proc sql and everything ran.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, honestly, I just re-copied your code to a new sas session and it ran perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, call me confused for now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2012 01:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97993#M20676</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-08-19T01:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97994#M20677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; SAS procedure steps terminate when one of these is encountered:&lt;/P&gt;&lt;P&gt;1) the beginning of the "next" DATA or PROC step&lt;/P&gt;&lt;P&gt;2) an explicit step boundary is reached (either RUN; or QUIT; as appropriate)&lt;/P&gt;&lt;P&gt;3) you are submitting a job in "batch" mode (such as in a SYSIN DD * on the mainframe) and the end of the input file is encountered (which would be */ on the mainframe). For example, you might have code in EG without ANY step boundaries, such as this:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; select *&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; from sashelp.class&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; order by age;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And the code in EG, when submitted, will produce results. There is NOTHING else in the file. No RUN; no QUIT; -- This might lead you to believe that RUN; or QUIT; is optional -- and the reason it is (sort of) optional for EG is that EG code is submitted in "batch" mode to the server, and in the wrapper code that EG adds to every submission is this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG style="font-family: terminal,monaco;"&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUIT; RUN;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Notice that EG adds a QUIT; and RUN; at the "bottom" of every submission of code to the server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, EG is protecting you from not having a final step boundary. If you try to run the above code in DISPLAY MANAGER, on the other hand, your SQL step will not execute and you will see the "PROC SQL RUNNING" message at the top of your window. If you try to get out of things by submitting just RUN; then you will see the following message in the log:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG style="font-family: terminal,monaco;"&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; When you finally submit a QUIT; in Display Manager or another step (like a PROC PRINT or PROC whatever), then that next PROC step causes the&amp;nbsp; PROC SQL step to terminate and the "PROC SQL RUNNING" message will go away. So if you submitted the above code two or three times, you would get output, because the second PROC SQL would terminate the first PROC SQL, but then the second PROC SQL would still be unterminated and you would still see "PROC SQL RUNNING" in your window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Another category of procedures that need QUIT; as the step boundary are the SAS/GRAPH procedures: GCHART, GPLOT, etc. Some of the STAT procedures end with QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The trouble with putting an SQL step or any unterminated PROC or DATA step into a macro program without a terminating QUIT; or RUN; as the step boundary is that you want your macro program to generate completely working code that will finish running all the steps before the next iteration of generated code hits the compiler and starts execution. It keeps your log messages cleaner and clearer and it simplifies debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; As a best practice (and for neatness), I recommend ending every step with the appropriate step boundary (either a RUN; or QUIT; as documented for your procedure of choice) If you want to, you can follow the EG model and use both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2012 16:09:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97994#M20677</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-08-19T16:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97995#M20678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL and/or global statements following the PROC SQL statement will be processed before PROC SQL goes into its waiting mode.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;If you try to run the above [unterminated] code in DISPLAY MANAGER, on the other hand, your SQL step will not execute&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 02:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97995#M20678</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-08-20T02:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97996#M20679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I misspoke. I meant to type "will appear not to execute" -- because you do not see any output from the step until the next step boundary happens. And if you keep submitting, over and over again, you will likely always have output that seems behind by 1 submission. Very frustrating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 02:22:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97996#M20679</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-08-20T02:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97997#M20680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A same activity as SQL&amp;nbsp; is proc datasets&amp;nbsp; which also need to use QUIT to end it .&amp;nbsp; You can keep submitting statements you want before QUIT ,sas will not end proc sql before quit which can save some resource . QUIT means end the run group .e.x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets libaray=work nolist;&lt;/P&gt;&lt;P&gt;modify class;&lt;/P&gt;&lt;P&gt; rename sex=f_m ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;repair class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;index create sex ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit; &amp;lt;-- end proc datasets&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 05:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97997#M20680</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-20T05:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97998#M20681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, some STAT procedures also support run groups, but proc SQL executes &lt;SPAN style="text-decoration: underline;"&gt;every&lt;/SPAN&gt; statement as soon as it's submitted. That's like having an implicit run statement after each query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I take away from this discussion is that the QUIT statement is &lt;STRONG&gt;good practice&lt;/STRONG&gt; but &lt;STRONG&gt;not essential &lt;/STRONG&gt;in SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 13:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97998#M20681</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-20T13:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97999#M20682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is true that some SQL statements will process without placing any messages in the log, But output (ODS or a CREATEd table or view) happens right away, before SQL waits for the next statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;select&lt;/SPAN&gt; * &lt;SPAN style="color: #0000ff;"&gt;from&lt;/SPAN&gt; sashelp.class ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;view&lt;/SPAN&gt; myview &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;select&lt;/SPAN&gt; * &lt;SPAN style="color: #0000ff;"&gt;from&lt;/SPAN&gt; sashelp.class ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;select&lt;/SPAN&gt; * &lt;SPAN style="color: #0000ff;"&gt;from&lt;/SPAN&gt; sashelp.class &lt;SPAN style="color: #0000ff;"&gt;where&lt;/SPAN&gt; age LT &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;11&lt;/STRONG&gt;&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;Cynthia@sas wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Yes, I misspoke. I meant to type "will appear not to execute" -- because you do not see any output from the step until the next step boundary happens. And if you keep submitting, over and over again, you will likely always have output that seems behind by 1 submission. Very frustrating.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 15:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/97999#M20682</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-08-20T15:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/98000#M20683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;Interesting!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;So OP would rather put:&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (nothing)&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;But OP's boss (or the one who is scolding OP) wants OP to put:&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUIT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;And the Enterprise Guide puts (twice, in fact):&lt;BR /&gt; &lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUIT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;Finally, &lt;A href="http://support.sas.com/resources/papers/proceedings12/150-2012.pdf"&gt;Vince&lt;/A&gt; puts the following at the end of every PROC (including PROC PRINT):&lt;/P&gt;&lt;P style="font-family: Consolas, Courier New; font-size: 90%; line-height: 1.1;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 18:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/98000#M20683</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2012-08-20T18:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/611917#M178461</link>
      <description>&lt;P&gt;On the contrary, I'd say the use of the `quit;` statement in `proc sql` is BAD practice as it encourages users to reinstantiate the procedure across multiple SQL statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see only one good reason to `quit;` and that is if you want to control the timing statistics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;quit quitting!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 20:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/611917#M178461</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2019-12-15T20:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/826806#M326586</link>
      <description>&lt;P&gt;The detailed explanation is very helpful!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 08:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/826806#M326586</guid>
      <dc:creator>DrAbhijeetSafai</dc:creator>
      <dc:date>2022-08-03T08:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/826809#M326587</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28909"&gt;@AllanBowe&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see only one good reason to `quit;` and that is if you want to control the timing statistics.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is the exact reason why I always QUIT. I want to see the stats of every single operation in SQL. Especially helpful when debugging/optimizing from the logs of batch jobs.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 08:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/826809#M326587</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-03T08:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/927152#M364883</link>
      <description>&lt;P&gt;I ran into a situation where the QUIT statement is important in PROC SQL.&amp;nbsp; I am running SAS 9.4 on Enterprise Guide 8.3, Update 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, if you run the two code blocks below you will get this warning message:&amp;nbsp;&amp;nbsp;WARNING: Output 'nlevels' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;proc sql;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; create table CLASS AS&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; select *&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; from sashelp.class;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;ods select none;&lt;/DIV&gt;
&lt;DIV&gt;ods output nlevels=temp;&lt;/DIV&gt;
&lt;DIV&gt;proc freq data=class nlevels;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;tables _all_;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;If you run the same two code blocks separately, you will not get a warning message.&amp;nbsp; Like Cynthia wrote above, a&amp;nbsp;&lt;SPAN&gt;SAS procedure step will terminate when &lt;/SPAN&gt;the beginning of the "next" DATA or PROC step is encountered.&amp;nbsp; With that in mind, I inserted a data _null_ code block like below and ran all three code blocks together and I did not receive a warning message.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;proc sql;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; create table CLASS AS&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; select *&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; from sashelp.class;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;data _null_;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; x=1;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;ods select none;&lt;/DIV&gt;
&lt;DIV&gt;ods output nlevels=temp;&lt;/DIV&gt;
&lt;DIV&gt;proc freq data=class nlevels;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;tables _all_;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;This finally led me to the solution - add QUIT at the end of the first code block.&amp;nbsp; The code below runs fine:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;proc sql;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; create table CLASS AS&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; select *&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; from sashelp.class;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;quit;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;ods select none;&lt;/DIV&gt;
&lt;DIV&gt;ods output nlevels=temp;&lt;/DIV&gt;
&lt;DIV&gt;proc freq data=class nlevels;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;tables _all_;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;This may have been obvious to some SAS veterans but it took me forever and a day to figure out.&amp;nbsp; I am posting what I learned in case anyone else runs into a similar situation.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 May 2024 11:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/927152#M364883</guid>
      <dc:creator>ANON4</dc:creator>
      <dc:date>2024-05-06T11:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/927157#M364887</link>
      <description>&lt;P&gt;You might find this discussion helpful even though it does not explicitly mention SQL.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_018/statug/statug_ods_examples06.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/v_018/statug/statug_ods_examples06.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 11:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/927157#M364887</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2024-05-06T11:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why use QUIT; with proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/927168#M364892</link>
      <description>&lt;P&gt;Short answer: Use QUIT to terminate interactive procedures. Reasons include both clarity and to ensure that ODS output (and other global SAS statements) are correctly applied. See this blog post from 2011:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2011/12/12/sas-tip-put-ods-statements-inside-procedures.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2011/12/12/sas-tip-put-ods-statements-inside-procedures.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 13:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-use-QUIT-with-proc-SQL/m-p/927168#M364892</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-05-06T13:20:25Z</dc:date>
    </item>
  </channel>
</rss>

