Production Ready Macros for SAS Application Developers File Reference

Searches all data in a library. More...

Go to the source code of this file.

Detailed Description

Scans an entire library and creates a copy of any table containing a specific string OR numeric value. Only matching records are written out. If both a string and numval are provided, the string will take precedence.


%mp_searchdata(lib=sashelp, string=Jan)
%mp_searchdata(lib=sashelp, numval=1)

Outputs zero or more tables to an MPSEARCH library with specific records.

lib=the libref to search (should be already assigned)
ds=the dataset to search (leave blank to search entire library)
string=the string value to search
numval=the numeric value to search (must be exact)
outloc=the directory in which to create the output datasets with matching rows. Will default to a subfolder in the WORK library.
outobs=set to a positive integer to restrict the number of observations
filter_text=add a (valid) filter clause to further filter the results

SAS Macros

Allan Bowe

Definition in file