DATA Step, Macro, Functions and more

Is it true we need QUIT statement for PROC DATASETS procedure rather than RUN? If so then why?

Reply
New Contributor
Posts: 4

Is it true we need QUIT statement for PROC DATASETS procedure rather than RUN? If so then why?

[ Edited ]

 Can someone please explain?

Pankajwa
Super User
Posts: 10,284

Re: Is it true we need QUIT statement for PROC DATASETS procedure rather than RUN? If so then why?

From the documentation:

Ending the Procedure

To stop the DATASETS procedure, you must issue a QUIT statement, a RUN CANCEL statement, a new PROC statement, or a DATA statement. Submitting a QUIT statement executes any statements that have not executed. Submitting a RUN CANCEL statement cancels any statements that have not executed.
 
 
Also read the paragraph for "Run group processing", as it will give you the important information what a run does in proc datasets, and what it doesn't (end the procedure).
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
SAS Super FREQ
Posts: 4,247

Re: Is it true we need QUIT statement for PROC DATASETS procedure rather than RUN? If so then why?

Yes, PROC DATASETS (along with PROC SQL and PROC IML and others) is a fully interactive procedure. That means that statements are executed as they are parsed.  This is different from procedures that use interactive "run groups" (such as PROC REG and GLM) in which a RUN statement executes a block of statements. See the section "A RUN statement in a fully interactive procedure" in the article "Do you write unnecessary SAS statements?"

PROC Star
Posts: 1,288

Re: Is it true we need QUIT statement for PROC DATASETS procedure rather than RUN? If so then why?

Adding to the answers of @KurtBremser and @Rick_SAS, the article PROC DATASETS; The Swiss Army Knife of SAS® Procedures is a great introduction to the procedure. Also it contains a section on the syntax and how it is structured with Run Groups.

Ask a Question
Discussion stats
  • 3 replies
  • 96 views
  • 0 likes
  • 4 in conversation