Exit Run in SAS

In SAS, what is the difference between quit and run? statements? I can not understand when to use "quit" and when to use "run"? For example, why proc datasets use quit , but proc contents using run

+6
source share
1 answer

This refers to where SAS was used as the mainframe (and still can be!).

RUN; - SAS command to run the presented operators. Returning to the older mainframes, operators will be sent to the SAS one at a time (or in batches, but the basic concept here is that each line is separate from the SAS point of view). SAS accepts assertions without any action until it reaches the RUN; value RUN; or something else that would create a step boundary (usually a different DATA or PROC ). At the data stage or non-interactive proc (proc means, for example, - proc, which can execute only one set of instructions and then exits), run tells it what it is doing (whatever), and then the slate returns to the space.

QUIT; used in an interactive programming environment. IML, SQL, many of the regression and modeling codes, FORMAT, TEMPLATE, DATASETS, etc. - Everything can be used interactively, that is, more than one set of instructions can be sent to them.

In these interactive cases, you want the SAS to execute and execute some instructions, but keep an open PROC environment - your next statement will be in the same PROC, for example. Some of them start immediately - PROC SQL - a good example of this - while some (in particular PROC) RUN; simulations RUN; they do something (he says that he runs the model so far), but he will not exit proc until QUIT; (or another step boundary requiring its exit, i.e. data / proc instruction). They are called “launch groups”, and “batch launch” is the term that you will see in connection with this.

You will find that some people put run; quit; run; quit; at every point that may be a suitable RUN; or QUIT; ; that nothing hurts, although it’s not quite “right.” And there are some cases when it is necessary for this!

One example:

 /* first run group*/ proc gplot data=sales; title1 "Sales Summary"; plot sales*model_a; run; /* second run group */ plot sales*model_b; run; quit; 

(from working group processing )

+12
source

All Articles