DLS(1)


NAME

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


SYNOPSIS

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

-a
    List members and members aliases.

-b
    List details, including block size.

-d
    Print out debug messages.

-h
    Display syntax help.

-j
    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.

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

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

-m
    List migrated datasets.

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

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

-u
    List details, including last reference (usage) time.

-v
    Print verbose information.

-V VOLSER
    Only display datasets that are on volume VOLSER.

DESCRIPTION

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.


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

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."
fi


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

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


EXIT VALUES

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

1
  No datasets were found.

other
  Error in dataset listing. See error messages for details.

SEE ALSO

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