DLS(1)


NAME

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


SYNOPSIS

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

-a
    List members and members aliases.

-b
    List details, including block size.

-d
    Print out debug messages.

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

-h
    Display syntax help.

-H
    Display a header for extended listings.

-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
    Include the dataset type.

-t TYPE
    Only display information for the specified dataset type.
    TYPE may be one of the following:
    AIX, CLUSTER, GDG, GDS, NONVSAM, PATH

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

-U
    Display dataset sizes in "human-readable" format, such as 1.1K,
    42M, or 123G, where 1K = 1024 bytes.

-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 -a option is provided, dls prints a list of members and their aliases for partitioned non-VSAM datasets. dls lists only aliases that are equal to or less than eight characters long.

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

Supported entry types are as follows:

  • AIX for alternate indexes. (Note: This AIX acronym is different from the IBM AIX operating system.)
  • CLUSTER for VSAM clusters and components.
  • GDG for generation data groups.
  • GDS for generation datasets.
  • NONVSAM for non-VSAM datasets.
  • PATH for VSAM paths.

When you specify the -F option, the catalog entry type is represented by a single character:

  • A for non-VSAM datasets.
  • B for generation data groups.
  • C for VSAM clusters.
  • D for VSAM data components.
  • G for VSAM alternate indexes.
  • H for generation datasets.
  • I for VSAM index components.
  • R for VSAM paths.

When you request detailed information, output is determined by dataset type as follows:

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

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

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