PROCEDURE dum$display_assigned_pps, display_assigned_pps, disap (
  output, o: file = $output
  status)

  VAR
    c$flags_starting_address: (READ) integer = 0
    c$pp_info_starting_address: (READ) integer = 0d(16)
  VAREND

  VAR
    cip_driver_name: string
    driver_name: string
    ignore_status: status
    index: integer
    iou_string: string
    last_lppt_ordinal: integer
    line_string: string
    logical_pp_string: string
    logical_pp_table: integer
    logical_pp_table_p: integer
    logical_pp_table_entry: integer
    logical_pp_table_entry_size: integer
    lppt_ordinal: integer
    number_of_entries: integer
    output_file: file
    pp_string: string
    pp_type: string
    start_lppt_ordinal: integer
    string_1: string
    string_2: string
    zero_string: string
  VAREND

  IF $file(output open_position) = '$BOI' THEN
    delete_file f=output status=ignore_status
  IFEND
  output_file = output.$eoi

  logical_pp_table_p = $symbol_address(cmv$logical_pp_table_p)
  logical_pp_table = $memory(logical_pp_table_p 6 monitor)
  logical_pp_table_entry_size = $memory((logical_pp_table_p + 14) 4 monitor)
  number_of_entries = $memory((logical_pp_table_p + 6) 4 monitor) / logical_pp_table_entry_size
  start_lppt_ordinal = $memory((logical_pp_table_p + 10) 4 monitor)
  last_lppt_ordinal = start_lppt_ordinal + number_of_entries - 1
  zero_string = '0'

  put_line l=' ' o=output_file
  put_line l=' IOU   PP        DRIVER_NAME  CIP_DRIVER_NAME  TYPE_OF_PP  LOGICAL_PP' o=output_file
  put_line l=' ********************************************************************' o=output_file

  FOR lppt_ordinal = start_lppt_ordinal TO last_lppt_ordinal DO
    logical_pp_table_entry = logical_pp_table + ((lppt_ordinal - 1) * logical_pp_table_entry_size)

    IF $memory((logical_pp_table_entry + c$flags_starting_address + 2) 1 monitor) = 1 THEN
      string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor))
      iou_string = 'IOU'//string_1

      string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + 2) 1 monitor) 8)
      IF $integer(string_1 8) <= 7 THEN
        string_2 = zero_string//string_1
      ELSE
        string_2 = string_1
      IFEND
      IF $memory((logical_pp_table_entry + c$pp_info_starting_address + 1) 1 monitor) = 0 THEN
        pp_string = 'PP'//string_2//'(8) '
      ELSE
        pp_string = 'CPP'//string_2//'(8)'
      IFEND

      IF $memory((logical_pp_table_entry + c$pp_info_starting_address + 5) 1 monitor) = 0 THEN
        pp_type = 'unknown'
      ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + 5) 1 monitor) = 1 THEN
        pp_type = 'other  '
      ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + 5) 1 monitor) = 2 THEN
        pp_type = 'disk   '
      ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + 5) 1 monitor) = 3 THEN
        pp_type = 'tape   '
      ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + 5) 1 monitor) = 4 THEN
        pp_type = 'network'
      ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + 5) 1 monitor) = 5 THEN
        pp_type = 'nad    '
      ELSE
        pp_type = '       '
      IFEND

      driver_name = $memory_string((logical_pp_table_entry + c$pp_info_starting_address + 58) 7 monitor)
      cip_driver_name = $memory_string((logical_pp_table_entry + c$pp_info_starting_address + 65) 7 monitor)
      logical_pp_string = $strrep(lppt_ordinal)

      line_string = ' '//iou_string//'  '//pp_string//'  '//driver_name//'      '
      line_string = line_string//cip_driver_name//'          '//pp_type//'     '//logical_pp_string
      put_line l=line_string o=output_file
    IFEND
  FOREND

PROCEND dum$display_assigned_pps
