PROC dum$display_apft_entry, display_apft_entry, disapfte (
  address, a : integer = $required
  output, o  : file = $output
  status     : var of status = $optional
  )

  " this displays a single attached pf entry and associated data structures
  " This proc converts any pointers pointed to by the base address to the
  " same segment as the parent address.
  crev ignore status
  IF $file($value(output) open_position) = '$BOI' THEN
    rewind_file $value(output) status=ignore
  IFEND
  output_file = $string($value(output)) // '.$eoi'

  entry_start = $value(address)

  valid_field_address = entry_start
  valid_entry_integer = $mem(valid_field_address, 1)
  valid_entry = (valid_entry_integer = $integer(true))
  "putl ' Valid entry = '//$strrep(valid_entry) o=$fname(output_file)
  IF NOT valid_entry THEN
    putl ' Invalid entry ' o=$fname(output_file)
    EXIT_PROC
  IFEND
  dism entry_start b=24 o=$fname(output_file)

  p_entry_field = valid_field_address + 1
  crev local status
  pfv$p_attached_pf_entry = $mem(p_entry_field)
  " Must convert to the parent segment because of the file server
  pfv$p_attached_pf_entry = $ring(entry_start)*100000000000(16) + ..
       $segment(entry_start)*100000000(16) + $offset(pfv$p_attached_pf_entry)
  putl ' p_attached_pf_entry  '//$strrep(pfv$p_attached_pf_entry, 16)//'(16)' o=$fname(output_file)
  " display this field
  " check for entry not in memory
  incl '   sfid_status_address = (pfv$p_attached_pf_entry) ' status=local
  IF NOT local.normal THEN
    EXIT_PROC WITH local
  IFEND
  sfid_state_integer = $mem(sfid_status_address, 1)
  crev sfid_state k=string d=0..2
  sfid_state(0) = ' pfc$attached_pf_normal'
  sfid_state(1) = ' pfc$attached_pf_awaiting_client'
  sfid_state(2) = ' pfc$attached_pf_in_job_recovery'
  IF sfid_state_integer <> 0 THEN
    putl ' sfid state '//sfid_state(sfid_state_integer) o=$fname(output_file)
  IFEND
  " display the sfid
  sfid_address = sfid_status_address + 1
  putl ' SFID '//$strrep($memory(sfid_address, 4), 16)//..
'(16) index(2 bytes)//residence(1 byte)//hash(1 byte) ' o=$fname(output_file)
  IF NOT $memory(sfid_address+4, 1) = $integer(on) THEN
    putl ' update_catalog '//$strrep($memory(sfid_address+4, 1)=$integer(on)) o=$fname(output_file)
  IFEND
  IF NOT $memory(sfid_address+5, 1) = $integer(on) THEN
    putl ' update_cycle_statistics '//$strrep($memory(sfid_address+5, 1)=$integer(on)) o=$fname(output_file)
  IFEND

  crev usage string
  convert_int_to_usage_string $memory(sfid_address+6, 1) usage
  putl ' access_modes '//usage o=$fname(output_file)
  crev share string
  convert_int_to_usage_string $memory(sfid_address+7, 1), share
  putl ' share_modes '//share o=$fname(output_file)

  " display the external path
  p_external_path_address = sfid_address + 17
  p_external_path = $mem(p_external_path_address)
  putl ' External path address '//$strrep(p_external_path, 16)//'(16)' o=$fname(output_file)
  external_path_size = $mem(p_external_path_address+6, 4)
  upper_bound = external_path_size / 31
  path = ' :'
  p_external_path = $ring(entry_start)*100000000000(16) + ..
       $segment(entry_start)*100000000(16) + $offset(p_external_path)
  FOR path_index = 2 TO upper_bound DO
    path = path // $memory_string(p_external_path+((path_index-1)*31), 31)
    path = $trim(path) // '.'
  FOREND
  path = path // $strrep($memory(p_external_path_address+18, 2))
  putl path o=$fname(output_file)

  gfn_size = 11
  internal_path_address = p_external_path_address + 20
".lrm.command_library.disbun internal_path_address cs=' cycle gfn: '
" dism internal_path_address
" FOR i = 1 to upper_bound do
"   internal_path_address = internal_path_address + gfn_size
".lrm.command_library.disbun internal_path_address cs=' cat '//$strrep(i)//' gfn: '
"FOREND

PROCEND dum$display_apft_entry
