DLS(1)


NAME

dls - List datasets that match a pattern. These can be non-VSAM datasets, generation datasets (GDS), and generation data groups (GDG).


SYNOPSIS

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

-a
    List members and members aliases.

-b
    List details, including block size.

-d
    Print out debug messages.

-F
    Display the dataset type identifier.
    Only available in conjunction with the -t option.

-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
    Display detailed information based on the dataset type.

-m
    List migrated datasets.

-q
    Enable quiet mode. Quiet mode suppresses all output except the exit value.

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

-t TYPE
    Only display information of the specified dataset type.

-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 datasets that match the pattern specified to stdout.

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

When the -t option is omitted, dls outputs non-VSAM dataset and generation dataset information by default.

The supported dataset types are:

  • NONVSAM for non-VSAM datasets.
  • GDS for generation datasets.
  • GDG for generation data groups.

If you specify the -F option the type is represented by a single character:

  • A for non-VSAM datasets.
  • H for generation datasets.
  • B for generation data groups.

When you request detailed information, output depends on dataset type:

  • For non-VSAM and generation datasets: recfm, lrecl, dsorg and volumes.
  • For generation data groups: limit, base attributes.

Specify -m to show migrated datasets. -m cannot be used with options -l, -s, -u, or -t.

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

{ "datasets": [], "gdgs":[] }

The "datasets" array contains only objects with the requested non-VSAM and generation dataset information, and the "gdgs" array contains only objects with the requested GDG information.

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 three 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)