|
Macros for SAS Application Developers
https://github.com/sasjs/core |
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 are often allocated very large widths (eg 32000) of which the maximum value is likely to be much narrower. Identifying such cases can be helpful in the following scenarios:
num2char=YES) MAXLEN=0 in the output table)If the entire column is made up of (non-special) missing values then a value of 0 is returned.
Usage:
%mp_getmaxvarlengths(sashelp.class,outds=work.myds)
| [in] | libds | Two part dataset (or view) reference. | ||||||||||||
| [in] | num2char= | (NO) When set to NO, numeric fields are sized according to the number of bytes used (or set to zero in the case of non-special missings). When YES, the numeric field is converted to character (using the format, if available), and that is sized instead, using lengthn(). | ||||||||||||
| [out] | outds= | The output dataset to create, eg:
|
Definition in file mp_getmaxvarlengths.sas.