This is a typical error in SAS which occurs when a variable gets calculated, i.e. it is the result of some arithmetic expression. Furthermore if this column is used to insert in DB2 table, it will fail and the operation will be rolled back. You can see similar error/warning in SAS LOGs.WARNING: Character expression will be truncated when assigned to character colum
ERROR: (ACDB2M011E) The column XXXXX cannot contain missing values
ERROR: ROLLBACK issued due to errors for data set XXX.
As the error suggest, it is due to some missing value of the variable(either calculated or read from input). You need to replace the missing value with Zero or in its own datatype(as defined). For discussion sake consider the variable to be WEIGHT. So, we need to set it to zero if it is missing. Also use the ROUND function to convert the exponent to number format.
IF WEIGHT= . THEN WRIGHT = 0;
WEIGHT = ROUND(WEIGHT,.01);
Using this piece of code will ensure the code doesn’t break.
Leave a comment