Neither one will terminate a SAS program. They are used to end steps.
Whether a step uses QUIT or not depends on whether it allows "run groups". That is that you can run something without leaving the procedure and then add more statements and run those. For procedures that support run groups you need to use the QUIT statement to end the procedure. Also PROC SQL needs a QUIT statement but it does NOT support the RUN statement, but that is because each statement runs immediately.
Neither one will terminate a SAS program. They are used to end steps.
Whether a step uses QUIT or not depends on whether it allows "run groups". That is that you can run something without leaving the procedure and then add more statements and run those. For procedures that support run groups you need to use the QUIT statement to end the procedure. Also PROC SQL needs a QUIT statement but it does NOT support the RUN statement, but that is because each statement runs immediately.
Hi @Tom
Sorry for digging this topic up, I am looking for the difference between RUN and QUIT and see this post.
I read your answer and @tsap additional document but I am still confused.
Could you please explain or give me an example for this sentence to me a little bit
run something without leaving the procedure and then add more statements and run those
and
Also PROC SQL needs a QUIT statement but it does NOT support the RUN statement, but that is because each statement runs immediately
Warm regards.
and
The QUIT statement is used for RUN-group processing that enables you to submit certain procedures with a RUN statement, but the RUN statement will not end the procedure. This allows you to continue to use the same procedure without submitting another procedure.
Warm regards.
Not sure if this will help or not but figured I would provide the information and source link:
The difference between a RUN statement and a QUIT statement is that a RUN statement executes previously submitted SAS statements and a QUIT statement executes previously submitted SAS statements and ends the procedure. The QUIT statement is used for RUN-group processing that enables you to submit certain procedures with a RUN statement, but the RUN statement will not end the procedure. This allows you to continue to use the same procedure without submitting another procedure. With RUN-group processing you must submit either a RUN CANCEL or a QUIT statement to end the procedure. A few examples of Base SAS procedures that are RUN-group processing procedures are: CATALOG, DATASETS, and PLOT. The SQL procedure is similar but each query is automatically executed, and a RUN statement or RUN CANCEL statement have no effect. In order to end the SQL procedure, you must use a QUIT statement.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.