DGREP(1)
DGREP(1) ZOAU Command Syntax DGREP(1)
NAME
dgrep: search for a pattern across all datasets (partitioned and
sequential) matching one or more dataset patterns.
SYNOPSIS
dgrep [-cdhinv] [-C<num>] <pattern> [<dataset-pattern>]+
-c print only the number of matches for each dataset
-d print debug messages
-h syntax
-i ignore case
-n display line numbers
-v print names of datasets being searched
-C display <num> lines of context around a match
DESCRIPTION
Search for <pattern> across the datasets specified in <dataset-pattern>
and write matching lines to the console.
If -i is specified, then the search is case insensitive.
If the -n option is specified, line numbers for the matching lines are
displayed.
If context lines are requested with the -C option, then up to <num>
lines before and after the matching line are also printed.
If you specify -m, you will force a recall of any datasets being
searched.
DATASET PATTERNS
The following rules apply to <dataset-pattern>.
• The high level qualifier (HLQ) must be specified in full.
• An asterisk (*) matches any sequence of characters.
• A question mark (?) matches a single character.
EXAMPLES
Search for 'rexx' (case sensitive) in all datasets matching IBM.TSO.*:
dgrep rexx 'IBM.TSO.*'
Search for 'Hi' (case insensitive) in all datasets matching IBM.*.C??:
dgrep -i Hi 'IBM.*.C??'
Get a count of lines containing 'rexx' in all datasets matching IBM.TSO.*:
dgrep -c rexx 'IBM.TSO.*'
EXIT VALUES
0 At least one match for pattern was found.
1 No matches for pattern were found.
other Error in search. See error messages for details.