Most SAS procedures require the
RUN;
statement to signal their termination. However, there are some notable exceptions to this.
I have written about PROC SQL many times on my blog, and this procedure requires the
QUIT;
statement instead.
It turns out that there is another set of statistical procedures that require the QUIT statement, and some of them are very common. They are called interactive procedures, and they include PROC REG, PROC GLM, and PROC ANOVA. If you end them with RUN rather than QUIT, then you will run into problems with displaying further output. For example, if you try to output a data set from one such PROC and end it with the RUN statement, then you will get this error message:
ERROR: You cannot open WORK.MYDATA.DATA for input access with record-level
control because WORK.MYDATA.DATA is in use by you in resource environment
REG.
WORK.MYDATA cannot be opened.
You will also notice that the Program Editor says “PROC … running” in its banner when you end such a PROC with RUN rather than QUIT.
I don’t like this exception, but, alas, it does exist. You can find out more about these interactive procedures in SAS Usage Note #37105. As this note says, the ANOVA, ARIMA, CATMOD, FACTEX, GLM, MODEL, OPTEX, PLAN, and REG procedures are interactive procedures, and they all require the QUIT statement for termination.
PROC IML is not mentioned in that usage note, but this procedure also requires the QUIT statement. Rick Wicklin has written an article about this on his blog, The DO Loop.
Recent Comments