If you specify the CODE= option in an UPDATE statement and there are uninitialized variables in the SAS® program, PROC IMSTAT updates every record in the target table. To avoid unintended updates, you should initialize all variables introduced in the user supplied SAS program. To initialize a variable, use a FORMAT statement, a LENGTH statement, or an assignment statement. (This does not apply to variables already in the active table being updated.)
Failure to initialize a variable can result in all records being updated. There are no notes in the SAS Log to indicate this has happened.
Here is an example. Suppose we load the SAS data set Sashelp.cars to LASR and run the following:
To avoid this problem, initialize the variable MANUFACTURER in the SAS program using any of the following methods: