Title
dslab -- Search for string in value labels
Syntax
dslab string [string [...] ] [, not match casesensitive variables( varlist) alpha]
Description
dslab searches string among all value labels in memory. In value labels any text associated with integers is searched. If a match is found all variables that have the respective value label attached are described.
The program is a hybrid combining elements of official Stata's ds and lookfor. Enclose string in double quotes to search for a phrase.
Options
not finds value labels in which string is not found.
match searches for stringpattern (see strmatch()). If match is specified wildcards * and ? are allowed in string, where the former means 0 or more characters the latter means exactly one character.
casesensitive performs a case sensitive search.
variables(varlist) searches string in value labels attached to varlist. Note that variables not in varlist are still described if they have the same value labels attached as variables in varlist.
alpha describes variables in alphabetical order.
Examples
. sysuse nlsw88 . dslab other . dslab other ,not
. dslab work . dslab *work* . dslab *work* ,match
. dslab not col
Saved results
dslab saves the following in r()
Macros r(lbllist) value labels in which string is found r(varlist) variables that have the respective value labels attached
Author
Daniel Klein, University of Bamberg, klein.daniel.81@gmail.com
Also see
Online: ds, lookfor, label
if installed: lookforit, labmatch, labutil2