PROCEDURE (HIDDEN) pfp$recover_system_catalogs (
  restore_excluded_file_cycles, refc: list of key
      none
      (no_data_defined, ndd)
      (volume_unavailable, vu)
      (media_missing, mm)
    keyend = (no_data_defined,media_missing)
  vsn_prefix, vsnp: any of
      name 1..5
      string 1..5
      integer 0..99999
    anyend = $optional
  vsn_count, vsnc: integer 1..11881376 = 9
  vsn_suffix, vsns: any of
      name 1..5
      string 1..5
      integer 0..99998
    anyend = $optional
  increment_scheme, is: key
      (alphabetic, a)
      (decimal, d)
    keyend = decimal
  vsn_list, vsnl: list of any of
      string 1..6
      name 1..6
    anyend = $optional
  file_label_type, flt: key
      (labeled, labelled, l)
      (unlabeled, unlabelled, u)
    keyend = labeled
  type, t: key
      mt9$800, mt9$1600, mt9$6250, mt18$38000
    keyend = mt9$6250
  output, o: file = $null
  status)

  "$FORMAT=OFF
  VAR
    backup_file: file=$fname('$local.'//$unique())
    restore_status: status
    volume_list: list 1 .. $max_list of string 6
  VAREND

  "$FORMAT=ON"

  IF $specified(vsn_list) THEN
    delete_variable volume_list
    volume_list = vsn_list
  ELSE
    pup$construct_volume_list vsn_count=vsn_count vsn_prefix=vsn_prefix increment_scheme=increment_scheme ..
          vsn_suffix=vsn_suffix volume_list=volume_list
  IFEND

  IF NOT $variable(cmv$deadstart_simulation, defined) THEN
    RESTORE_PERMANENT_FILES
      set_restore_missing_catalogs operation=start
    QUIT
  IFEND

  request_magnetic_tape file=backup_file type=type ring=no ..
        recorded_vsn=volume_list
  set_file_attributes backup_file file_label_type=file_label_type
  IF NOT $variable(cmv$deadstart_simulation, defined) THEN
    vedisplay display_option=tape_mount
  IFEND

  TASK ring=3
    RESTORE_PERMANENT_FILES list=output
      set_restore_options require_matching_modification=false update_cycle_statistics=false..
            restore_archive_information=TRUE
      IF NOT $variable(cmv$deadstart_simulation, defined) THEN
        restore_missing_catalogs backup_file=backup_file ..
              restore_excluded_file_cycles=restore_excluded_file_cycles status=restore_status
      IFEND
    QUIT
    change_file_attributes file=output ring_attributes=(11 11 11)
  TASKEND

  IF NOT $variable(cmv$deadstart_simulation, defined) THEN
    vedisplay display_option=null
  IFEND

  delete_file backup_file

  EXIT_PROC WITH restore_status

PROCEND pfp$recover_system_catalogs

