BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kamal5522
Obsidian | Level 7
I am new to SAS. Could you please advise what is the difference b/w Run and Quit, both can be used to terminate the programme.
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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. 

 

 

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

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. 

 

 

Phil_NZ
Barite | Level 11

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.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
tsap
Pyrite | Level 9

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.

 

http://support.sas.com/kb/40/887.html

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 3 replies
  • 22932 views
  • 4 likes
  • 4 in conversation