Production Ready Macros for SAS Application Developers File Reference

Scans a dataset to find the max length of the variable values. More...

Go to the source code of this file.

Detailed Description

This macro will scan a base dataset and produce an output dataset with two columns:

  • NAME Name of the base dataset column
  • MAXLEN Maximum length of the data contained therein.

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:

libdsTwo part dataset (or view) reference.
outds=The output dataset to create

SAS Macros

Allan Bowe

Definition in file