PROC DATASETS supports
RUN-group processing. RUN-group processing enables you to submit RUN
groups without ending the procedure.
The DATASETS procedure
supports four types of RUN groups. Each RUN group is defined by the
statements that compose it and by what causes it to execute.
Some statements in PROC
DATASETS act as implied RUN statements because they cause the RUN
group preceding them to execute.
The following list discusses
what statements compose a RUN group and what causes each RUN group
to execute:
-
The PROC DATASETS statement always
executes immediately. No other statement is necessary to cause the
PROC DATASETS statement to execute. Therefore, the PROC DATASETS
statement alone is a RUN group.
-
The MODIFY statement, and any of
its subordinate statements, form a RUN group. These RUN groups always
execute immediately. No other statement is necessary to cause a MODIFY
RUN group to execute.
-
The APPEND, CONTENTS, and COPY
statements (including EXCLUDE and SELECT, if present), form their
own separate RUN groups. Every APPEND statement forms a single-statement
RUN group; every CONTENTS statement forms a single-statement RUN group;
and every COPY step forms a RUN group. Any other statement in the
procedure, except those that are subordinate to either the COPY or
MODIFY statement, causes the RUN group to execute.
-
One or more of the following statements
form a RUN group:
If any of these statements
appear in sequence in the PROC step, the sequence forms a RUN group.
For example, if a REPAIR statement appears immediately after a SAVE
statement, the REPAIR statement does not force the SAVE statement
to execute; it becomes part of the same RUN group. To execute the
RUN group, submit one of the following statements:
-
-
-
-
-
-
-
-
another DATA or PROC step
SAS reads the program
statements that are associated with one task until it reaches a RUN
statement or an implied RUN statement. SAS executes all of the preceding
statements immediately and continues reading until it reaches another
RUN statement or implied RUN statement. To execute the last task,
you must use a RUN statement or a statement that stops the procedure.
The following PROC DATASETS
step contains five RUN groups:
LIBNAME dest 'SAS-library';
/* RUN group */
proc datasets;
/* RUN group */
change nutr=fatg;
delete bldtest;
exchange xray=chest;
/* RUN group */
copy out=dest;
select report;
/* RUN group */
modify bp;
label dias='Taken at Noon';
rename weight=bodyfat;
/* RUN group */
append base=tissue data=newtiss;
quit;
Note: If you are running in interactive
line mode, you can receive messages that statements have already executed
before you submit a RUN statement. Plan your tasks carefully if you
are using this environment for running PROC DATASETS.