The warning "Multiple lengths were specified for the BY variable xxxx by input data sets" might be issued when merging data sets


Beginning in SAS® Version 7, a warning message like the following is produced by the DATA step to highlight a mismatch in the defined length of BY variables:

WARNING: Multiple lengths were specified for the BY variable xxxx by input data sets

In previous releases of SAS, it was possible to merge data sets with BY variables of different lengths, thus risking data integrity due to possible truncation of values. Note that the merge still occurs when this message is issued.

To ensure that truncation of values has not occurred, do one of the following:

For more information about multiple lengths for a variable, see the following SAS articles:

SAS Note 31850, "Using the LENGTH statement might produce a warning and rc=4"

SAS KB0041748, "The VARLENCHK= system option excludes BY variables"