My X-Mas List – I

Only report a problem when it occurs.

*options varlenchk=warn;

data demo;
    set sashelp.class (keep=name sex where=(length(name)=4));

data demo;
    length name $4;
    set demo;

By default, the global option varlenchk=warn.

The following message is displayed in the log when a data step is used to reduce the length of a variable.

WARNING: Multiple lengths were specified for the variable name by input data set(s). This can cause truncation of data.

Instead of suggesting that values may be truncated, I’d like the system to check for itself and let me know only if this is indeed the case.