Scans a dataset to find the max length of the variable values. More...
This macro will scan a base dataset and produce an output dataset with two columns:
Character fields may be allocated very large widths (eg 32000) of which the maximum value is likely to be much narrower. This macro was designed to enable a HTML table to be appropriately sized however this could be used as part of a data audit to ensure we aren't over-sizing our tables in relation to the data therein.
Numeric fields are converted using the relevant format to determine the width. Usage:
|libds||Two part dataset (or view) reference.|
|outds=||The output dataset to create|
Definition in file mp_getmaxvarlengths.sas.