PROCEDURE dum$display_dat_header, display_dat_header, disdh (
  address, a: integer = $optional
  display_option, do: key full, f, brief, b, keyend = brief
  access_mode, am: key sva, pva, keyend = sva
  output, o: file = $output
  help, h: file = $null
  status)

  WHEN any_fault DO
    putl ' entered disdh condition handler - enter commands or exit_proc to abort'
    disv osv$status
    incf command
  WHENEND

  IF $specified(help) THEN
COLLECT_TEXT o=$value(help) until='HELPEND'
DISPLAY_DAT_HEADER or DISDH

  This procedure will display the device allocation table header and describe
the contents of selected fields of the table.  This procedure assumes the user
has previously selected the correct exchange package by available analyze_dump
commands.

PARAMETERS:

ADDRESS, A: integer
  This parameter is the address of the data to be displayed as the device
allocation table header.  See the parameter access_mode for further details on
acceptable integer values for input.  This parameter is required.

DISPLAY_OPTIONS, DO: key full, f, brief, b
  This parameter selects the option of displaying the contents of memory
and the description of the selected fields (full), or the brief
mode of the descriptions only.  This parameter defaults to brief.

ACCESS_MODE, AM: key sva, pva
  This parameter selects the mode in which memory is accessed by the add-
ress parameter.  A processor virtual address or system virtual address
may be entered.  This parameter defaults to sva.

OUTPUT, O: file
  This parameter selects the file name to receive the data.  This para-
meter is defaulted to $output.  If a file name other than $output is
entered the data will be formated correctly for printer disposition and
will be sent to the file  "$asis".

STATUS

WARNINGS/KNOWN DEFICIENCIES:

ERROR HANDLER
  When any fatal error is encountered a condition handler is invoked and
the following message will appear:
"entered disdh condition handler - enter commands or exit_proc to abort".
This will be followed by the error status.  To exit the handler enter:
 "exit_proc".

HELPEND
    EXIT_PROC
  IFEND

  IF NOT $specified(address) THEN
    EXIT_PROC WITH $status(false, 'US', 3, 'Parameter ADDRESS is required')
  IFEND

  IF $file($value(output) open_position) = '$BOI' THEN
    output_file = $string($value(output))//'.$asis'
  ELSE
    output_file = $string($value(output))
  IFEND

  create_variable name=column_2_num kind=integer value=39
  create_variable name=column_3_num kind=integer value=50
  create_variable name=column_4_num kind=integer value=59
  create_variable name=line_first_part kind=string
  create_variable name=line_secnd_part kind=string
  create_variable name=blank_fill_count kind=integer
  create_variable name=blank_line kind=string value='                                                    '
  crev output_line k=string v=' '
  dat_start = $value(address)

  IF $strrep($value(output)) = '$OUTPUT' THEN
    put_line '1DAT HEADER   ADDRESS = '//$strrep($value(address), 16)//' (16)' o=$fname(output_file)
  IFEND

  IF (display_option = 'FULL') THEN
    dism dat_start b=828(16) am=$value(access_mode) t='DAT HEADER '//$strrep($value(address), 16)//'(16)' ..
          o=$fname(output_file)
  IFEND

  putl '  ' o=$fname(output_file)
  locked = $mem(dat_start+16, 8, j, 0, $value(access_mode))
  IF locked <> 0 THEN
    putl ' dat is locked by task '//$strrep(locked) o=$fname(output_file)
  ELSE
    putl ' dat is NOT locked' o=$fname(output_file)
  IFEND

  bytes_per_dau = $mem(dat_start+24, 2, j, 0, $value(access_mode))
  output_line = ' bytes/dau = '//$strrep(bytes_per_dau, 16)//'(16)'
  bytes_per_mau = $mem(dat_start+26, 2, j, 0, $value(access_mode))
  output_line = output_line//'      bytes/mau = '//$strrep(bytes_per_mau, 16)//'(16)'
  putl output_line o=$fname(output_file)
  output_line = ' '

  daus_per_cyl = $mem(dat_start+28, 1, j, 0, $value(access_mode))
  maus_per_dau = $mem(dat_start+29, 1, j, 0, $value(access_mode))
  output_line = ' daus/cylinder = '//$strrep(daus_per_cyl, 16)//'(16)'
  output_line = output_line//'    maus/dau = '//$strrep(maus_per_dau)
  putl output_line o=$fname(output_file)
  output_line = ' '

  cyl_per_dev = $mem(dat_start+30, 2, j, 0, $value(access_mode))
  num_entries = $mem(dat_start+32, 3, j, 0, $value(access_mode))
  output_line = ' daus_per_device = '//$strrep(num_entries)
  output_line = output_line//'    cylinders/device = '//$strrep(cyl_per_dev)
  putl output_line o=$fname(output_file)
  output_line = ' '
  putl output_line o=$fname(output_file)

  putl ' DAUS PER ALLOCATION STYLE:' o=$fname(output_file)
  a0 = $mem(dat_start+48, 1, j, 0, $value(access_mode))
  a1 = $mem(dat_start+49, 1, j, 0, $value(access_mode))
  a2 = $mem(dat_start+50, 1, j, 0, $value(access_mode))
  a3 = $mem(dat_start+51, 1, j, 0, $value(access_mode))
  a4 = $mem(dat_start+52, 1, j, 0, $value(access_mode))
  a5 = $mem(dat_start+53, 1, j, 0, $value(access_mode))
  a6 = $mem(dat_start+54, 1, j, 0, $value(access_mode))
  a7 = $mem(dat_start+55, 1, j, 0, $value(access_mode))
  a8 = $mem(dat_start+56, 1, j, 0, $value(access_mode))
  acyl = $mem(dat_start+57, 1, j, 0, $value(access_mode))
  output_line = '      a0 = '//$strrep(a0)//'  a1 = '//$strrep(a1)//'  a2 = '//$strrep(a2)
  output_line = output_line//'  a3 = '//$strrep(a3)//'  a4 = '//$strrep(a4)
  putl output_line o=$fname(output_file)
  output_line = ' '
  output_line = '      a5 = '//$strrep(a5)//'  a6 = '//$strrep(a6)//'  a7 = '//$strrep(a7)
  output_line = output_line//'  a8 = '//$strrep(a8)//'  acyl = '//$strrep(acyl)
  putl output_line o=$fname(output_file)
  output_line = ' '
  putl output_line o=$fname(output_file)

  putl ' POOL INFO:            allocated   available      off      warn     ' o=$fname(output_file)
  perm_alloc = $mem(dat_start+60, 3, j, 0, $value(access_mode))
  perm_avail = $mem(dat_start+63, 3, j, 0, $value(access_mode))
  devi_alloc = $mem(dat_start+66, 3, j, 0, $value(access_mode))
  devi_avail = $mem(dat_start+69, 3, j, 0, $value(access_mode))
  cata_alloc = $mem(dat_start+72, 3, j, 0, $value(access_mode))
  cata_avail = $mem(dat_start+75, 3, j, 0, $value(access_mode))
  temp_alloc = $mem(dat_start+78, 3, j, 0, $value(access_mode))
  temp_avail = $mem(dat_start+81, 3, j, 0, $value(access_mode))
  gene_alloc = $mem(dat_start+84, 3, j, 0, $value(access_mode))
  gene_avail = $mem(dat_start+87, 3, j, 0, $value(access_mode))
  perm_off = $mem(dat_start+96, 3, j, 0, $value(access_mode))
  perm_wrn = $mem(dat_start+99, 3, j, 0, $value(access_mode))
  devi_off = $mem(dat_start+102, 3, j, 0, $value(access_mode))
  devi_wrn = $mem(dat_start+105, 3, j, 0, $value(access_mode))
  cata_off = $mem(dat_start+108, 3, j, 0, $value(access_mode))
  cata_wrn = $mem(dat_start+111, 3, j, 0, $value(access_mode))
  temp_off = $mem(dat_start+114, 3, j, 0, $value(access_mode))
  temp_wrn = $mem(dat_start+117, 3, j, 0, $value(access_mode))
  gene_off = $mem(dat_start+120, 3, j, 0, $value(access_mode))
  gene_wrn = $mem(dat_start+123, 3, j, 0, $value(access_mode))
  line_first_part = '    permanent            '//$strrep(perm_alloc)
  line_secnd_part = $strrep(perm_avail)
  blank_fill_count = (column_2_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(perm_off)
  blank_fill_count = (column_3_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(perm_wrn)
  blank_fill_count = (column_4_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  putl line_first_part o=$fname(output_file)

  line_first_part = '    device               '//$strrep(devi_alloc)
  line_secnd_part = $strrep(devi_avail)
  blank_fill_count = (column_2_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(devi_off)
  blank_fill_count = (column_3_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(devi_wrn)
  blank_fill_count = (column_4_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  putl line_first_part o=$fname(output_file)

  line_first_part = '    catalog              '//$strrep(cata_alloc)
  line_secnd_part = $strrep(cata_avail)
  blank_fill_count = (column_2_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(cata_off)
  blank_fill_count = (column_3_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(cata_wrn)
  blank_fill_count = (column_4_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  putl line_first_part o=$fname(output_file)

  line_first_part = '    temp                 '//$strrep(temp_alloc)
  line_secnd_part = $strrep(temp_avail)
  blank_fill_count = (column_2_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(temp_off)
  blank_fill_count = (column_3_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(temp_wrn)
  blank_fill_count = (column_4_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  putl line_first_part o=$fname(output_file)

  line_first_part = '    general              '//$strrep(gene_alloc)
  line_secnd_part = $strrep(gene_avail)
  blank_fill_count = (column_2_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(gene_off)
  blank_fill_count = (column_3_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  line_secnd_part = $strrep(gene_wrn)
  blank_fill_count = (column_4_num)-($strlen(line_first_part))
  line_first_part = line_first_part//$substr(blank_line, 1, blank_fill_count)//line_secnd_part
  putl line_first_part o=$fname(output_file)

PROCEND dum$display_dat_header
