## zowe › zos-files › search › data-sets

Search all data sets and PDS members that match the data set name for a search term.

#### Usage

zowe zos-files search data-sets <pattern> <searchString> [options]

#### Positional Arguments

- `pattern` (string)

  - The pattern to match data sets against. Also known as 'DSLEVEL'. The following special sequences can be used in the pattern:
    %: matches any single character
    *: matches any number of characters within a data set name qualifier (e.g. "ibmuser.j*.old" matches "ibmuser.jcl.old" but not "ibmuser.jcl.very.old")
    **: matches any number of characters within any number of data set name qualifiers (e.g. "ibmuser.**.old" matches both "ibmuser.jcl.old" and "ibmuser.jcl.very.old")
    However, the pattern cannot begin with any of these sequences. You can specify multiple patterns separated by commas, for example "ibmuser.**.cntl,ibmuser.**.jcl"

- `searchString` (string)

  - The parameter to search for.

#### Options

- `--case-sensitive` | `--cs` (boolean)

  - The search should be case sensitive

    Default value: false

- `--encoding` | `--ec` (string)

  - Search the file content with encoding mode, which means that data conversion is performed using the file encoding specified.

- `--mainframe-search` | `--ms` (boolean)

  - Perform a preliminary search on the mainframe, reducing network traffic. However, this option does not work with data sets that contain binary data. This option should be omitted if any data sets may be in binary format. Failure to do so may result in an incomplete set of search results.

    Default value: false

- `--max-concurrent-requests` | `--mcr` (number)

  - Specifies the maximum number of concurrent z/OSMF REST API requests to search files. Increasing the value results in faster searches. However, increasing the value increases resource consumption on z/OS and can be prone to errors caused by making too many concurrent requests.

    Default value: 1

- `--timeout` | `--to` (number)

  - The number of seconds to search before timing out.

- `--regex` | `--re` (boolean)

  - Whether the search string is a regular expression.

    Default value: false

- `--response-timeout` | `--rto` (number)

  - The maximum amount of time in seconds the z/OSMF Files TSO servlet should run before returning a response. Any request exceeding this amount of time will be terminated and return an error. Allowed values: 5 - 600

#### Zosmf Connection Options

- `--host` | `-H` (string)

  - The z/OSMF server host name.

- `--port` | `-P` (number)

  - The z/OSMF server port.

    Default value: 443

- `--user` | `-u` (string)

  - Mainframe (z/OSMF) user name, which can be the same as your TSO login.

- `--password` | `--pass` | `--pw` (string)

  - Mainframe (z/OSMF) password, which can be the same as your TSO password.

- `--reject-unauthorized` | `--ru` (boolean)

  - Reject self-signed certificates.

    Default value: true

- `--base-path` | `--bp` (string)

  - The base path for your API mediation layer instance. Specify this option to prepend the base path to all z/OSMF resources when making REST requests. Do not specify this option if you are not using an API mediation layer.

- `--protocol` (string)

  - The protocol used (HTTP or HTTPS)

    Default value: https
    Allowed values: http, https

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

#### Profile Options

- `--zosmf-profile` | `--zosmf-p` (string)

  - The name of a (zosmf) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### Base Connection Options

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

#### Examples

- Search all of IBMUSER's data sets for 'ZOWE':

  - `zowe zos-files search data-sets 'IBMUSER.*' 'ZOWE'`

- Search all of IBMUSER's data sets for 'ZOWE' in uppercase only:

  - `zowe zos-files search data-sets 'IBMUSER.*' 'ZOWE' --case-sensitive`

- Search all of IBMUSER's data sets for 'ZOWE', and time out in 1 minute:

  - `zowe zos-files search data-sets 'IBMUSER.*' 'ZOWE' --timeout 60`

- Search all of IBMUSER's data sets for 'ZOWE', and perform 8 parallel tasks:

  - `zowe zos-files search data-sets 'IBMUSER.*' 'ZOWE' --max-concurrent-requests 8`

- Search all of IBMUSER's data sets using a regular expression:

  - `zowe zos-files search data-sets 'IBMUSER.*' 'Z([A-Za-z]){3}' --regex`