Scans a dataset to find the max length of the variable values. More...
Go to the source code of this file.
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:
%mp_getmaxvarlengths(sashelp.class,outds=work.myds);
libds | Two part dataset (or view) reference. |
outds= | The output dataset to create |
Definition in file mp_getmaxvarlengths.sas.