Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mp_searchdata.sas 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.

Usage:

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

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

Parameters
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

Dependencies

Version
9.2
Author
Allan Bowe

Definition in file mp_searchdata.sas.