DHEAD(1)


NAME

dhead - Print out the head of a non-VSAM dataset.

SYNOPSIS

dhead [-bdhjJlv] [-n <LINE_COUNT>] DATASET

-b
    Prints out dataset contents in "binary mode".

-d
    Print out debug messages.

-h
    Display syntax help.

-j
    Print output in JSON format.
    Options -b (binary mode) and -l (newline suppression) are ignored,
    and do not affect JSON output. This means records with NULL bytes
    get truncated and each record is followed by a line break.

    Output appears in this form:
      { "data": { "content": "..." }, "records":<records printed>,
      "content_length":<characters read from the dataset> }

-J
    Prints JSON output in a readable format.
    This option forces -j if it was not set.

-l
    Suppresses printing of newline characters between dataset records.

-n LINE_COUNT
    Display the first LINE_COUNT lines from the dataset.

-v
    Print verbose information.

DESCRIPTION

dhead prints out the head of a non-VSAM dataset, which can be either a partitioned dataset member or a sequential dataset.

dhead can print active generation datasets referenced by absolute or relative names.

If the -n argument is specified, the first LINE_COUNT lines of the dataset are printed. If the argument is omitted, then the first ten lines are printed.


EXAMPLES

Display the first ten lines of the PDS member TEST.TEXT(MSG):

dhead 'TEST.TEXT(MSG)'


Display only the first three lines of a sequential dataset called TSTRADM.MY.TEXT:

dhead -n 3 'TSTRADM.MY.TEXT'


Display the first two records of IBMUSER.MY.TEXT in a readable JSON format:

dhead -J -n 2 'IBMUSER.MY.TEXT'

Output:
{
  "data": {
      "content": "Record 1
      Record 2
      "
  },
  "records": 2,
  "content_length": 162
}


EXIT VALUES

0
    dhead completed without error.

non-zero
    dhead failed. See error messages for details.

SEE ALSO

dcat(1), decho(1), dtail(1)