Managing SAS Data Libraries |
The DATASETS procedure is an interactive procedure; that is, the procedure remains active after a RUN statement is executed. After you start the procedure, you can continue to manipulate files within a SAS data library until you have finished all the tasks that you have planned. This capability can save time and resources when you have a number of tasks for one session.
Here are some important features to know about the DATASETS procedure:
You can specify the input library in the PROC DATASETS statement.
When you start the DATASETS procedure, you can also specify the input library, which is referred to as the procedure input library. If you do not specify a library as the source of files, then SAS uses the default library, which could be the temporary library WORK or the USER library. To specify a different input library, you must start the procedure again.
Statements execute in the order in which they are written.
For example, to see the contents of a SAS data set, to copy a data set from another library, and then to see the contents of the second data set so that you can visually compare with the first data set, the SAS statements that perform those tasks must be specified in that order so that they execute correctly.
Groups of statements can execute without a RUN statement.
For the DATASETS procedure only, SAS recognizes these statements as implied RUN statements and therefore executes them immediately when you submit them:
SAS reads the statements that are associated with one task until it reaches one of the above statements. SAS executes all of the preceding statements immediately and then continues reading until it reaches another of the above statements. To cause the last task to execute, you must submit a RUN or QUIT statement.
Note: If you are running in interactive line mode, then this feature enables you to receive messages that statements have already executed before you submit a RUN statement.
The RUN statement does not stop a PROC DATASETS step.
You must submit a QUIT statement, a new PROC statement, or a DATA step. Submitting a QUIT statement executes any statements that have not executed and ends the procedure.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.