dls - List non-VSAM datasets that match a pattern.


dls [-abdhjJlmqsuv] [-V VOLSER] [<DATASET_PATTERN>]+

    List members and members aliases.

    List details, including block size.

    Print out debug messages.

    Display syntax help.

    Print the output in JSON format, instead of a list.
    JSON output is only enabled when detailed information is
    requested with one of the -blsu options.

    Make the JSON output readable.
    This option forces -j if it was not set.

    List details (recfm, lrecl, dsorg, volumes).

    List migrated datasets.

    Enable quiet mode; disable output, set exit value only.

    Include dataset size (estimate of used, allocated sizes).

    List details, including last reference (usage) time.

    Print verbose information.

    Only display datasets that are on volume VOLSER.


dls lists sequential and partitioned datasets matching the pattern specified to stdout.

Multi-volume data sets will produce a line of output for each utilized volume when -b, -l, -s, or -u are specified.

If you specify -m, migrated datasets will also be shown. You can not specify -m with any of the -l, -s, or -u arguments.

When JSON output is requested, the response has the following form:

{ "datasets": [] }

Where the datasets array contains only objects with the requested dataset information.

NOTE: If your locale is set to En_GB.IBM-285, any dollar sign ($) characters in a dataset name will be automatically translated to the pound sterling character.


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.


List all non-VSAM datasets under your default high-level-qualifier:

dls -l "`hlq`.*"

Get a JSON object with detailed information for datasets under your high-level-qualifier:

dls -j -bsu "$(hlq).*"

List all non-VSAM datasets that have an HLQ of TEST followed by TSTR and then exactly 3 characters, with a low level qualifier of JCL:

dls -l 'test.tstr???.*.jcl'

Test whether a dataset exists:

dls -q ${prefix}.my.jcl
if [ $? -eq 0 ]; then
  echo "Dataset exists."

List all the non-VSAM datasets that match the pattern TEST.**.X*: and volume VOLSER:

dls -l -V VOLSER TEST.**.X*


  At least one dataset was found matching a <dataset-pattern>

  No datasets were found.

  Error in dataset listing. See error messages for details.


dinfo(1), dcp(1), drm(1), dtouch(1), dls(1), decho(1), ddiff(1), dgrep(1), dsed(1), mrm(1), mls(1)