Using PROC IMPORT with the REPLACE argument to output to an existing SAS® generation data set deletes the data set and all existing generations


There is a loss of data issue using the IMPORT procedure with the REPLACE argument when output is to an existing SAS generation data set. The result deletes the SAS generation data set and all existing generations. A new output data set is created but it is not a SAS generation data set.

When writing to an existing SAS generation data set with the IMPORT procedure using the REPLACE argument and the GENMAX= data set option is not specified, all existing generations are deleted and replaced with a single new data set of the same name, but it is not a generation data set.

When writing to an existing SAS generation data set with the IMPORT procedure using the REPLACE argument and the GENMAX= data set option is specified to increase or decrease the existing number of generations, all existing generations are deleted and replaced with a single new base generation data set.

When using the IMPORT procedure to output to a new SAS data set that does not already exist, you can specify the GENMAX= data set option to properly create a new SAS generation data set.

Instead of using the IMPORT procedure, it is recommended that you use the DATA step with the INFILE and INPUT statements, along with the REPLACE SAS system option, to replace and maintain an existing SAS generation data set.