REPEMPTY= Data Set Option

Specifies whether a new, empty data set can overwrite an existing SAS data set that has the same name.

Valid in: DATA step and PROC steps
Category: Data Set Control
Restriction: Use with output data sets only.

Syntax

REPEMPTY=YES | NO

Syntax Description

YES

specifies that a new empty data set with a given name replaces an existing data set with the same name. This is the default.

Interaction If REPEMPTY=YES and REPLACE=NO, then the data set is not replaced.

NO

specifies that a new empty data set with a given name does not replace an existing data set with the same name.

Tips Use REPLACE=YES and REPEMPTY=NO for the convenience of replacing existing data sets with new ones that contain data.
Use REPEMPTY=NO to prevent the following syntax error from replacing the existing data set B with the new empty data set B that is created by mistake:
data mylib.a set b;
Use REPLACE=YES and REPEMPTY=NO for the protection of not overwriting existing data sets with new empty ones that are created by mistake.

Details

For an individual data set, the REPEMPTY= data set option overrides the REPEMPTY= option in the LIBNAME statement.

Comparisons

  • The REPEMPTY= and REPLACE= data set options apply to permanent and temporary SAS data sets. However, the REPLACE system option only applies to permanent SAS data sets.

See Also

Data Set Options:
Statement Options:
REPEMPTY=YES|NO in SAS Statements: Reference
System Options:
REPLACE System Option in SAS System Options: Reference