*! version 1.0.0 25sept2018

lookfor2 -- Search for string in variable names, variable
labels, value labels, and notes

Syntax

lookfor2 string
[string [...]], [options]

nonote do not search the notes

novallab do not search the value labels

Description

lookfor2 helps you find variables by searching for
string among all variable names,
variable labels, value labels, and
notes attached to variables. If multiple strings are
specified, lookfor2 will search for each of them separately. You may
search for a phrase by enclosing string in double quotes.

Examples

Setup

. sysuse nlsw88

. notes hours : per week

Find all occurrences of union in variable names, notes, variable and
value labels

. lookfor2 union

Find all occurrences of single in variable names, notes, variable
and value labels

. lookfor2 single

Find all occurrences of week in variable names, notes, variable
and value labels

. lookfor2 week

Find all occurrences of week in variable names, variable
and value labels, but exclude notes

. lookfor2 week, nonote

Stored results

lookfor2 stores the following in r():

Macros

r(varlist) the varlist of found variables