?? TITLE := 'NOS/VE Permanent Files : Ring 3 Interfaces' ??
MODULE pfm$program_interface_processor;
?? RIGHT := 110 ??

{ PURPOSE:
{   This module contains the 23d interfaces.  Parameter validation is performed
{   in this module.

?? NEWTITLE := '  Global Declarations Referenced by this module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc oss$job_paged_literal
*copyc oss$task_shared
*copyc fsc$local
*copyc fsc$max_path_element_size
*copyc fsc$max_path_elements
*copyc fsc$max_path_size
*copyc jmc$system_family
*copyc pfc$max_shared_queue
*copyc pfc$movc_insuf_space
*copyc pfc$movc_no_space
*copyc pfc$null_shared_queue
*copyc pfc$shared_queues
*copyc osd$virtual_address
*copyc dfe$error_condition_codes
*copyc fse$open_validation_errors
*copyc fse$system_conditions
*copyc fse$vxve_exception_conditions
*copyc ofe$error_codes
*copyc ose$heap_full_exceptions
*copyc pfe$error_condition_codes
*copyc pfe$external_archive_conditions
*copyc pfe$get_object_info_errors
*copyc pfe$internal_error_conditions
*copyc rme$class_validation_errors
*copyc rme$request_mass_storage
*copyc ste$error_condition_codes
*copyc dmt$error_condition_codes
*copyc dmt$file_information
*copyc fmt$removable_media_req_info
*copyc fst$date_time
*copyc fst$device_class
*copyc fst$file_changes
*copyc fst$path_element_name
*copyc ost$caller_identifier
*copyc ost$name_reference
*copyc pft$catalog_cycle_attributes
*copyc pft$purge_cycle_options
*copyc pft$reserved_cycles
*copyc pft$retained_restore_status
*copyc pft$variant_path
*copyc rmt$device_class
?? POP ??
*copyc avp$family_administrator
*copyc avp$get_name_value
*copyc avp$ring_min
*copyc avp$security_option_active
*copyc avp$system_administrator
*copyc bap$fetch_tape_validation
*copyc clp$convert_date_time_to_string
*copyc clp$convert_file_ref_to_string
*copyc clp$convert_integer_to_rjstring
*copyc clp$date_time_compare
*copyc clp$trimmed_string_size
*copyc clp$validate_name
*copyc clp$validate_new_file_name
*copyc cmp$class_in_volume
*copyc cmp$get_ms_volume_info
*copyc cmp$get_ms_volumes
*copyc dfp$check_self_serving_job
*copyc dfp$locate_served_family
*copyc dmp$get_file_info
*copyc dsp$get_data_from_rdf
*copyc dsp$store_data_in_rdf
*copyc fsp$evaluate_file_reference
*copyc gfp$get_segment_sfid
*copyc jmp$get_scheduling_admin_status
*copyc jmp$operator_job
*copyc mmp$open_file_segment
*copyc mmp$verify_access
*copyc ofp$format_operator_menu
*copyc osp$add_family
*copyc osp$append_status_integer
*copyc osp$append_status_parameter
*copyc osp$delete_family
*copyc osp$get_family_names_by_set
*copyc osp$get_set_name
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc osp$verify_system_privilege
*copyc pfp$convert_archive_ident
*copyc pfp$convert_fs_to_complete_path
*copyc pfp$convert_fs_to_pft$path
*copyc pfp$convert_pf_path_to_fs_path
*copyc pfp$convert_pf_to_fs_structure
*copyc pfp$convert_pft$path_to_fs_path
*copyc pfp$convert_pft$path_to_fs_str
*copyc pfp$convert_pft$path_to_string
*copyc pfp$detach_all_catalogs
*copyc pfp$find_cycle_array
*copyc pfp$find_cycle_array_version_2
*copyc pfp$find_next_info_record
*copyc pfp$find_permit_array
*copyc pfp$get_authority
*copyc pfp$get_eval_file_ref_mast_cat
*copyc pfp$get_ownership
*copyc pfp$get_permit_level
*copyc pfp$locate_group_info_record
*copyc pfp$log_error
*copyc pfp$process_unexpected_status
*copyc pfp$r1_get_catalog_alarm_table
*copyc pfp$r2_append_rem_media_vsn
*copyc pfp$r2_attach
*copyc pfp$r2_attach_or_create_file
*copyc pfp$r2_build_sorted_dfl
*copyc pfp$r2_change
*copyc pfp$r2_change_catalog_name
*copyc pfp$r2_change_cycle_damage
*copyc pfp$r2_change_cycle_date_time
*copyc pfp$r2_change_file
*copyc pfp$r2_change_res_to_releasable
*copyc pfp$r2_define
*copyc pfp$r2_define_catalog
*copyc pfp$r2_define_data
*copyc pfp$r2_delete_all_arch_entries
*copyc pfp$r2_delete_archive_entry
*copyc pfp$r2_delete_catalog_permit
*copyc pfp$r2_delete_permit
*copyc pfp$r2_detach_reserved_cycles
*copyc pfp$r2_df_client_app_rem_me_vsn
*copyc pfp$r2_df_client_change
*copyc pfp$r2_df_client_change_cy_dam
*copyc pfp$r2_df_client_change_cy_dt
*copyc pfp$r2_df_client_change_file
*copyc pfp$r2_df_client_change_res_rel
*copyc pfp$r2_df_client_define
*copyc pfp$r2_df_client_define_catalog
*copyc pfp$r2_df_client_define_data
*copyc pfp$r2_df_client_del_all_arc_en
*copyc pfp$r2_df_client_del_arch_entry
*copyc pfp$r2_df_client_delete_permit
*copyc pfp$r2_df_client_get_family_set
*copyc pfp$r2_df_client_get_famit_info
*copyc pfp$r2_df_client_get_info
*copyc pfp$r2_df_client_get_mcat_info
*copyc pfp$r2_df_client_mark_rel_cand
*copyc pfp$r2_df_client_permit
*copyc pfp$r2_df_client_purge
*copyc pfp$r2_df_client_purge_catalog
*copyc pfp$r2_df_client_put_arch_entry
*copyc pfp$r2_df_client_put_arch_info
*copyc pfp$r2_df_client_put_cycle_info
*copyc pfp$r2_df_client_put_item_info
*copyc pfp$r2_df_client_release_data
*copyc pfp$r2_df_client_rep_arch_entry
*copyc pfp$r2_df_client_rep_rem_me_fmd
*copyc pfp$r2_df_client_resolve
*copyc pfp$r2_df_client_save_rel_label
*copyc pfp$r2_dm_attach_item
*copyc pfp$r2_flush_catalog
*copyc pfp$r2_get_attached_pf_table
*copyc pfp$r2_get_catalog_segment
*copyc pfp$r2_get_family_info
*copyc pfp$r2_get_item_info
*copyc pfp$r2_get_master_catalog_info
*copyc pfp$r2_get_move_obj_device_info
*copyc pfp$r2_get_multi_item_info
*copyc pfp$r2_get_object_information
*copyc pfp$r2_get_queued_catalog_table
*copyc pfp$r2_get_stored_fmd
*copyc pfp$r2_get_stored_fmd_size
*copyc pfp$r2_mark_release_candidate
*copyc pfp$r2_overhaul_catalog
*copyc pfp$r2_overhaul_set
*copyc pfp$r2_permit
*copyc pfp$r2_permit_catalog
*copyc pfp$r2_physically_move_catalog
*copyc pfp$r2_physically_move_cycle
*copyc pfp$r2_purge
*copyc pfp$r2_purge_catalog
*copyc pfp$r2_purge_object
*copyc pfp$r2_put_archive_entry
*copyc pfp$r2_put_archive_info
*copyc pfp$r2_put_catalog_media_info
*copyc pfp$r2_put_catalog_segment
*copyc pfp$r2_put_cycle_info
*copyc pfp$r2_put_family_info
*copyc pfp$r2_put_file_media_info
*copyc pfp$r2_put_item_info
*copyc pfp$r2_put_master_catalog_info
*copyc pfp$r2_recreate_system_catalog
*copyc pfp$r2_release_data
*copyc pfp$r2_replace_archive_entry
*copyc pfp$r2_replace_rem_media_fmd
*copyc pfp$r2_resolve_path
*copyc pfp$r2_save_released_file_label
*copyc pfp$r2_validate_catalog_exists
*copyc pfp$system_privilege
*copyc pmp$compute_date_time
*copyc pmp$compute_date_time_increment
*copyc pmp$get_account_project
*copyc pmp$get_compact_date_time
*copyc pmp$get_job_names
*copyc pmp$get_pseudo_mainframe_id
*copyc pmp$get_unique_name
*copyc pmp$get_user_identification
*copyc pmp$log_ascii
*copyc pmp$verify_compact_date
*copyc pmp$verify_compact_time
*copyc pmp$wait
*copyc rmp$build_mass_storage_info
*copyc sfp$accumulate_file_space
*copyc sfp$auditing_operation
*copyc sfp$emit_audit_statistic
*copyc stp$get_active_set_list
*copyc stp$get_volumes_in_set
*copyc stp$get_volumes_set_name
*copyc stp$search_ast_by_set
*copyc dmv$active_volume_table
*copyc pfv$debug_catalog_access
*copyc pfv$permit_level
*copyc stv$system_set_name
*copyc pfi$convert_cycle_reference
*copyc pfi$convert_password
*copyc pfi$get_family_from_fs_struct

  VAR
    pfv$catalog_access_retry_wait: [XREF] integer;

?? TITLE := '  Global Declarations Declared by this module', EJECT ??

  CONST
    include_radix = TRUE,
    radix = 10,
    update_catalog = TRUE;

  TYPE
    audit_ownership_rec = record
      case ownership_known: boolean of
      = FALSE =
        system_privilege: boolean,
      = TRUE =
        ownership: pft$ownership,
      casend,
    recend;

  TYPE
    path_types = (catalog_path, file_path, item_path, new_catalog_path, new_file_path, new_item_path);

  TYPE
    shared_queue_conv_entry = record
      shared_queue_name: ost$name,
      shared_queue: pft$shared_queue,
    recend;

  CONST
    c$null_site_option = 0,
    c$site_archive_options = 'SITE_ARCHIVE_OPTIONS',
    c$site_backup_options = 'SITE_BACKUP_OPTIONS',
    c$site_release_options = 'SITE_RELEASE_OPTIONS';

  TYPE
    t$site_option = 0 .. 255;

  TYPE
    t$validation_control = (c$vc_not_verified, c$vc_normal_user, c$vc_family_administrator,
          c$vc_system_administrator);

  VAR
    pfv$flush_catalogs: [XDCL, #GATE, oss$task_shared] boolean := TRUE,
    pfv$reserved_cycle_info: [XDCL, #GATE, oss$task_shared, READ] pft$reserved_cycle_info :=
          [ * , NIL, 0, NIL],
    pfv$space_character: [XDCL, #GATE, oss$job_paged_literal, READ] set of char := [' '];

  VAR
    shared_queue_conv_table: [oss$job_paged_literal, READ] array [1 .. pfc$max_shared_queue] of
          shared_queue_conv_entry := [['SITE_01', pfc$sq_site_01], ['SITE_02', pfc$sq_site_02],
          ['SITE_03', pfc$sq_site_03], ['SITE_04', pfc$sq_site_04], ['SITE_05', pfc$sq_site_05],
          ['SITE_06', pfc$sq_site_06], ['SITE_07', pfc$sq_site_07], ['SITE_08', pfc$sq_site_08],
          ['SITE_09', pfc$sq_site_09], ['SITE_10', pfc$sq_site_10], ['SITE_11', pfc$sq_site_11],
          ['SITE_12', pfc$sq_site_12], ['SITE_13', pfc$sq_site_13], ['SITE_14', pfc$sq_site_14],
          ['SITE_15', pfc$sq_site_15], ['SITE_16', pfc$sq_site_16], ['SITE_17', pfc$sq_site_17],
          ['SITE_18', pfc$sq_site_18], ['SITE_19', pfc$sq_site_19], ['SITE_20', pfc$sq_site_20],
          ['SITE_21', pfc$sq_site_21], ['SITE_22', pfc$sq_site_22], ['SITE_23', pfc$sq_site_23],
          ['SITE_24', pfc$sq_site_24], ['SITE_25', pfc$sq_site_25]],
    valid_object_info_requests: [oss$job_paged_literal, READ] fst$goi_object_info_requests :=
          [fsc$goi_set_name, fsc$goi_catalog_identity, fsc$goi_applicable_cat_permit,
          fsc$goi_catalog_device_info, fsc$goi_catalog_info, fsc$goi_catalog_permits, fsc$goi_catalog_size,
          fsc$goi_catalog_object_list, fsc$goi_file_object_list, fsc$goi_file_identity,
          fsc$goi_applicable_file_permit, fsc$goi_file_info, fsc$goi_file_log, fsc$goi_file_permits,
          fsc$goi_cycle_object_list, fsc$goi_cycle_identity, fsc$goi_archive_info, fsc$goi_cycle_device_info,
          fsc$goi_cycle_info, fsc$goi_cycle_size, fsc$goi_file_label, fsc$goi_job_environment_info];

?? TITLE := 'P$VALIDATE_SITE_OPTION', EJECT ??

  PROCEDURE p$validate_site_option
    (    family: pft$name;
         site_option: t$site_option;
         site_option_name: string ( * <= osc$max_name_size);
     VAR validation_control: {input/output} t$validation_control;
     VAR status: ost$status);

    VAR
      found: boolean,
      i: integer,
      name_list_size: avt$name_list_size,
      option_string: string (3),
      p_name_list: ^avt$name_list,
      search_name: ost$name,
      user_identification: ost$user_identification,
      validation_name: ost$name;

    CASE validation_control OF
    = c$vc_family_administrator, c$vc_system_administrator =
      RETURN; {----->

    = c$vc_not_verified =
      IF avp$system_administrator () THEN
        validation_control := c$vc_system_administrator;
        RETURN; {----->
      IFEND;

      pmp$get_user_identification (user_identification, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      IF avp$family_administrator () AND (family = user_identification.family) THEN
        validation_control := c$vc_family_administrator;
        RETURN; {----->
      ELSE
        validation_control := c$vc_normal_user;
      IFEND;

    = c$vc_normal_user =
      ;
    CASEND;

    PUSH p_name_list: [1 .. 10];
    validation_name := site_option_name;
    avp$get_name_value (validation_name, avc$user, p_name_list^, name_list_size, status);
    IF status.normal AND (name_list_size > 10) THEN
      PUSH p_name_list: [1 .. name_list_size];
      avp$get_name_value (validation_name, avc$user, p_name_list^, name_list_size, status);
    IFEND;

    IF NOT status.normal THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$no_site_option_validation, site_option_name,
            status);
      osp$append_status_integer (osc$status_parameter_delimiter, site_option, radix, NOT include_radix,
            status);
      RETURN; {----->
    IFEND;

    clp$convert_integer_to_rjstring (site_option, radix, NOT include_radix, {file_character} '0',
          option_string, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    search_name := 'SITE_';
    search_name (6, 3) := option_string;

    found := FALSE;

  /locate_name/
    FOR i := 1 TO name_list_size DO
      IF p_name_list^ [i] = 'ALL' THEN
        found := TRUE;
        EXIT /locate_name/; {----->
      ELSEIF p_name_list^ [i] = 'NONE' THEN
        EXIT /locate_name/; {----->
      ELSEIF p_name_list^ [i] = search_name THEN
        found := TRUE;
        EXIT /locate_name/; {----->
      IFEND;
    FOREND /locate_name/;

    IF NOT found THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$no_site_option_validation, site_option_name,
            status);
      osp$append_status_integer (osc$status_parameter_delimiter, site_option, radix, NOT include_radix,
            status);
      RETURN; {----->
    IFEND;

  PROCEND p$validate_site_option;
?? TITLE := '[inline] P$VALIDATE_CATALOG_CYCLE_ATTR', EJECT ??

  PROCEDURE [INLINE] p$validate_catalog_cycle_attr
    (    family: pft$name;
         catalog_cycle_attributes: pft$catalog_cycle_attributes;
     VAR status: ost$status);

    VAR
      validation_control: t$validation_control;

    status.normal := TRUE;
    validation_control := c$vc_not_verified;

    IF catalog_cycle_attributes.retention.selector = fsc$retention_day_increment THEN
      check_retention (catalog_cycle_attributes.retention.day_increment, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    IF catalog_cycle_attributes.site_archive_option <> pfc$null_site_archive_option THEN
      p$validate_site_option (family, catalog_cycle_attributes.site_archive_option, c$site_archive_options,
            validation_control, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    IF catalog_cycle_attributes.site_backup_option <> pfc$null_site_backup_option THEN
      p$validate_site_option (family, catalog_cycle_attributes.site_backup_option, c$site_backup_options,
            validation_control, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    IF catalog_cycle_attributes.site_release_option <> pfc$null_site_release_option THEN
      p$validate_site_option (family, catalog_cycle_attributes.site_release_option, c$site_release_options,
            validation_control, status);
    IFEND;

  PROCEND p$validate_catalog_cycle_attr;
?? TITLE := '  [XDCL, #GATE] pfp$audit_save_label', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$audit_save_label
    (    variant_path: pft$variant_path;
         p_save_label_audit_info: {input^} ^pft$save_label_audit_info;
         audit_status: ost$status);

    VAR
      audit_information: sft$audit_information,
      audited_object: sft$audited_fs_object_id;

    osp$verify_system_privilege;

    audit_information.audited_operation := sfc$ao_fs_change_attribute;
    audited_object.variant_path := variant_path;
    audited_object.object_type := sfc$afsot_cycle;
    audited_object.cycle_selector_p := ^p_save_label_audit_info^.cycle_selector;
    audited_object.device_class := p_save_label_audit_info^.device_class;
    audit_information.change_fs_object_attribute.object_id_p := ^audited_object;
    audit_information.change_fs_object_attribute.ownership := p_save_label_audit_info^.ownership;

    IF p_save_label_audit_info^.fap_audit_info.audit THEN
      audit_information.change_fs_object_attribute.attribute := sfc$afsoa_fap_name;
      audit_information.change_fs_object_attribute.fap_name :=
            p_save_label_audit_info^.fap_audit_info.fap_name;
      sfp$emit_audit_statistic (audit_information, audit_status);
    IFEND;

    IF p_save_label_audit_info^.ring_audit_info.audit THEN
      audit_information.change_fs_object_attribute.attribute := sfc$afsoa_ring_attributes;
      audit_information.change_fs_object_attribute.ring_attributes :=
            p_save_label_audit_info^.ring_audit_info.ring_attributes;
      sfp$emit_audit_statistic (audit_information, audit_status);
    IFEND;
  PROCEND pfp$audit_save_label;

?? TITLE := '  [XDCL, #GATE] pfp$build_sorted_dfl', EJECT ??
*copy pfh$build_sorted_dfl

  PROCEDURE [XDCL, #GATE] pfp$build_sorted_dfl
    (VAR status: ost$status);

    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_system_administrator,
            'pfp$build_sorted_dfl', status);
      RETURN; {----->
    IFEND;

    pfp$r2_build_sorted_dfl (status);
  PROCEND pfp$build_sorted_dfl;

?? TITLE := '  [XDCL, #GATE] pfp$catalog_access_retry_wait', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$catalog_access_retry_wait
    (    procedure_name: string ( * ));

    VAR
      ignore_status: ost$status,
      length: integer,
      line: string (256);

    IF pfv$debug_catalog_access THEN
      STRINGREP (line, length, 'Retrying call to ', procedure_name, ' on blocked access to catalog.');
      pmp$log_ascii (line (1, length), $pmt$ascii_logset [pmc$job_log, pmc$system_log], pmc$msg_origin_system,
            ignore_status);
    IFEND;

    pmp$wait (pfv$catalog_access_retry_wait, pfv$catalog_access_retry_wait);

  PROCEND pfp$catalog_access_retry_wait;

?? TITLE := '  [XDCL, #GATE] pfp$change_family_name', EJECT ??
*copy pfh$change_family_name

  PROCEDURE [XDCL, #GATE] pfp$change_family_name
    (    set_name: stt$set_name;
         family_name: pft$name;
         new_family_name: pft$name;
     VAR status: ost$status);

    VAR
      family_path: array [1 .. pfc$family_path_index] of pft$name,
      local_family_name: pft$name,
      local_new_family_name: pft$name,
      local_set_name: stt$set_name;

    status.normal := TRUE;
    convert_set_name (family_name, local_set_name, status);

    IF status.normal THEN
      convert_family_name (family_name, catalog_path, local_family_name, status);
    IFEND;

    IF status.normal THEN
      convert_family_name (new_family_name, new_catalog_path, local_new_family_name, status);
    IFEND;

    IF status.normal THEN
      family_path [pfc$set_path_index] := local_set_name;
      family_path [pfc$family_path_index] := local_family_name;

    /change_catalog_name/
      WHILE TRUE DO
        pfp$r2_change_catalog_name (family_path, local_new_family_name, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /change_catalog_name/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_CHANGE_CATALOG_NAME');
        IFEND;
      WHILEND /change_catalog_name/;
    IFEND;

    IF status.normal THEN
      osp$delete_family (local_family_name, status);
      osp$add_family (local_new_family_name, local_set_name, status);
    IFEND;

  PROCEND pfp$change_family_name;

?? TITLE := '  [XDCL, #GATE] pfp$convert_fs_retention_to_int', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$convert_fs_retention_to_int
    (    fs_retention: fst$retention;
     VAR days: integer;
     VAR status: ost$status);

    CONST
      days_per_month = 30.4375, { ((3.0 * 365.0) + 366.0) / (4.0 * 12.0) }
      days_per_year = 365.25; { ((3.0 * 365.0) + 366.0) / (4.0) }

    VAR
      int_total_days: integer,
      now: ost$date_time,
      real_total_days: real,
      time_increment: pmt$time_increment;

    status.normal := TRUE;

    CASE fs_retention.selector OF
    = fsc$retention_day_increment =
      days := fs_retention.day_increment;
    = fsc$retention_time_increment =
      time_increment := fs_retention.time_increment;
    = fsc$retention_expiration_date =
      pmp$get_compact_date_time (now, status);
      IF status.normal THEN
        pmp$compute_date_time_increment (now, fs_retention.expiration_date, time_increment, status);
      IFEND;
    CASEND;

    IF status.normal AND (fs_retention.selector <> fsc$retention_day_increment) THEN
      real_total_days := $REAL (time_increment.day) + ($REAL (time_increment.month) * days_per_month) +
            ($REAL (time_increment.year) * days_per_year);
      int_total_days := $INTEGER (real_total_days);
      IF real_total_days > $REAL (int_total_days) THEN
        days := int_total_days + 1;
      ELSE
        days := int_total_days;
      IFEND;
    IFEND;

  PROCEND pfp$convert_fs_retention_to_int;

?? TITLE := '  [XDCL, #GATE] pfp$convert_shared_queue_to_ord', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$convert_shared_queue_to_ord
    (    shared_queue_name: ost$name;
     VAR shared_queue: pft$shared_queue;
     VAR status: ost$status);

    VAR
      index: integer;

    status.normal := TRUE;

    IF shared_queue_name = 'SYSTEM' THEN
      shared_queue := pfc$null_shared_queue;
    ELSE
      FOR index := LOWERBOUND (shared_queue_conv_table) TO UPPERBOUND (shared_queue_conv_table) DO
        IF shared_queue_name = shared_queue_conv_table [index].shared_queue_name THEN
          shared_queue := shared_queue_conv_table [index].shared_queue;
          RETURN; {----->
        IFEND;
      FOREND;
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$invalid_shared_queue_name,
            shared_queue_name, status);
    IFEND;

  PROCEND pfp$convert_shared_queue_to_ord;

?? TITLE := '  [XDCL, #GATE] pfp$convert_ord_to_shared_queue', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$convert_ord_to_shared_queue
    (    shared_queue: pft$shared_queue;
     VAR shared_queue_name: ost$name;
     VAR status: ost$status);

    VAR
      index: integer;

    status.normal := TRUE;

    FOR index := LOWERBOUND (shared_queue_conv_table) TO UPPERBOUND (shared_queue_conv_table) DO
      IF shared_queue = shared_queue_conv_table [index].shared_queue THEN
        shared_queue_name := shared_queue_conv_table [index].shared_queue_name;
        RETURN; {----->
      IFEND;
    FOREND;

    osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$invalid_shared_queue_ord, '', status);
    osp$append_status_integer (osc$status_parameter_delimiter, shared_queue, {radix} 10,
          {include_radix_specifier} FALSE, status);

  PROCEND pfp$convert_ord_to_shared_queue;

?? TITLE := '  [XDCL, #GATE] pfp$define_master_catalog', EJECT ??
*copy pfh$define_master_catalog

  PROCEDURE [XDCL, #GATE] pfp$define_master_catalog
    (    set_name: stt$set_name;
         family_name: pft$name;
         master_catalog_name: pft$name;
         charge_id: pft$charge_id;
     VAR status: ost$status);

    VAR
      audit_ownership: audit_ownership_rec,
      caller_id: ost$caller_identifier,
      current_set_name: stt$set_name,
      family_path: array [1 .. pfc$family_path_index] of pft$name,
      local_charge_id: pft$charge_id,
      local_family_name: pft$name,
      local_master_catalog_name: pft$name,
      local_set_name: stt$set_name,
      local_status: ost$status,
      master_catalog_path: array [1 .. pfc$master_catalog_path_index] of pft$name,
      system_privilege: boolean,
      user_id: ost$user_identification,
      variant_path: pft$variant_path;

    #CALLER_ID (caller_id);
    status.normal := TRUE;

    clp$validate_name (set_name, local_set_name, local_status.normal);
    IF NOT local_status.normal THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_set_name, set_name, local_status);
    IFEND;

    IF local_status.normal THEN
      convert_family_name (family_name, catalog_path, local_family_name, local_status);
    IFEND;

    IF local_status.normal THEN
      convert_master_catalog_name (master_catalog_name, new_catalog_path, local_master_catalog_name,
            local_status);
    IFEND;

    IF local_status.normal THEN
      convert_charge_id (charge_id, local_charge_id, local_status);
    IFEND;

    IF local_status.normal THEN
      pmp$get_user_identification (user_id, local_status);
    IFEND;

    IF local_status.normal THEN
      osp$get_set_name (local_family_name, current_set_name, local_status);
      IF local_status.normal AND (current_set_name <> local_set_name) THEN
        {
        { Family already exists in a different set.
        {
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$family_already_exists, local_family_name,
              local_status);
      ELSE
        local_status.normal := TRUE;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      master_catalog_path [pfc$set_path_index] := local_set_name;
      master_catalog_path [pfc$family_path_index] := local_family_name;
      master_catalog_path [pfc$master_catalog_path_index] := local_master_catalog_name;
      {
      { The determination of system_privilege should not be based upon the
      { $system master catalog, but rather on whether the user is attempting to
      { create his own master catalog.
      {
      system_privilege := pfp$system_privilege (caller_id.ring, jmc$system_user) AND
            (user_id.family = local_family_name) AND (user_id.user = local_master_catalog_name);

    /define_catalog_1/
      WHILE TRUE DO
        pfp$r2_define_catalog (master_catalog_path, local_charge_id, system_privilege,
              {catalog_type_selected} FALSE, pfc$external_catalog, {p_mass_storage_request_info} NIL,
              local_status);
        IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
          EXIT /define_catalog_1/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_DEFINE_CATALOG');
        IFEND;
      WHILEND /define_catalog_1/;

      IF local_status.normal OR ((local_status.condition <> pfe$unknown_family) AND
            (local_status.condition <> pfe$duplicate_master_catalog)) THEN
        IF avp$security_option_active (avc$vso_security_audit) THEN
          variant_path.complete_path := TRUE;
          variant_path.p_complete_path := ^master_catalog_path;
          audit_ownership.ownership_known := FALSE;
          audit_ownership.system_privilege := system_privilege;
          audit_catalog_creation (variant_path, audit_ownership, local_status);
        IFEND;
      ELSEIF local_status.condition = pfe$unknown_family THEN
        family_path [pfc$set_path_index] := local_set_name;
        family_path [pfc$family_path_index] := local_family_name;

      /define_catalog_2/
        WHILE TRUE DO
          pfp$r2_define_catalog (family_path, local_charge_id, system_privilege,
                {catalog_type_selected} FALSE, pfc$external_catalog, {p_mass_storage_request_info} NIL,
                local_status);
          IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
            EXIT /define_catalog_2/; {----->
          ELSE
            pfp$catalog_access_retry_wait ('PFP$R2_DEFINE_CATALOG');
          IFEND;
        WHILEND /define_catalog_2/;

        IF avp$security_option_active (avc$vso_security_audit) THEN
          variant_path.complete_path := TRUE;
          variant_path.p_complete_path := ^family_path;
          audit_ownership.ownership_known := FALSE;
          audit_ownership.system_privilege := system_privilege;
          audit_catalog_creation (variant_path, audit_ownership, local_status);
        IFEND;

        IF local_status.normal THEN
          osp$add_family (local_family_name, local_set_name, local_status);

          IF local_status.normal THEN

          /define_master_catalog_3/
            WHILE TRUE DO
              pfp$r2_define_catalog (master_catalog_path, local_charge_id, system_privilege,
                    {catalog_type_selected} FALSE, pfc$external_catalog, {p_mass_storage_request_info} NIL,
                    local_status);
              IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
                EXIT /define_master_catalog_3/; {----->
              ELSE
                pfp$catalog_access_retry_wait ('PFP$R2_DEFINE_CATALOG');
              IFEND;
            WHILEND /define_master_catalog_3/;

            IF avp$security_option_active (avc$vso_security_audit) THEN
              variant_path.p_complete_path := ^master_catalog_path;
              audit_catalog_creation (variant_path, audit_ownership, local_status);
            IFEND;
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      IF local_status.condition = dme$unable_to_alloc_all_space THEN
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$no_space_for_master_catalog,
              master_catalog_name, status);
        osp$append_status_parameter (osc$status_parameter_delimiter, family_name, status);
      ELSE
        status := local_status;
      IFEND;
    IFEND;

  PROCEND pfp$define_master_catalog;

?? TITLE := '  [XDCL, #GATE] pfp$detach_jobs_catalogs', EJECT ??
*copy pfh$detach_jobs_catalogs

  PROCEDURE [XDCL, #GATE] pfp$detach_jobs_catalogs;

    pfp$detach_all_catalogs;
  PROCEND pfp$detach_jobs_catalogs;

?? TITLE := '  [XDCL, #GATE] pfp$detach_reserved_cycles', EJECT ??
*copy pfh$detach_reserved_cycles

  PROCEDURE [XDCL, #GATE] pfp$detach_reserved_cycles
    (VAR status: ost$status);

    VAR
      mainframe_id: pmt$binary_mainframe_id;

    status.normal := TRUE;

    IF pfv$reserved_cycle_info.p_catalog_path = NIL THEN
      RETURN; {----->
    IFEND;

    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_system_administrator,
            'pfp$detach_reserved_cycles', status);
      RETURN; {----->
    IFEND;

    pmp$get_pseudo_mainframe_id (mainframe_id);

  /detach_reserved_cycles/
    WHILE TRUE DO
      pfp$r2_detach_reserved_cycles (mainframe_id, status);
      IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
        EXIT /detach_reserved_cycles/; {----->
      ELSE
        pfp$catalog_access_retry_wait ('PFP$R2_DETACH_RESERVED_CYCLES');
      IFEND;
    WHILEND /detach_reserved_cycles/;

  PROCEND pfp$detach_reserved_cycles;

?? TITLE := '  [XDCL] pfp$dm_attach_item', EJECT ??

*copy pfh$dm_attach_item

  PROCEDURE [XDCL] pfp$dm_attach_item
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
     VAR sfid: gft$system_file_identifier;
     VAR status: ost$status);

    VAR
      p_complete_path: pft$p_complete_path;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, {minimum_path_length} 1, item_path, p_complete_path^, status);
    IF status.normal THEN

    /dm_attach_item/
      WHILE TRUE DO
        pfp$r2_dm_attach_item (p_complete_path^, cycle_selector, sfid, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /dm_attach_item/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$DM_ATTACH_ITEM');
        IFEND;
      WHILEND /dm_attach_item/;
    IFEND;
  PROCEND pfp$dm_attach_item;

?? TITLE := '  [XDCL, #GATE] pfp$get_attached_pf_table', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_attached_pf_table
    (VAR p_info: pft$p_table_info;
     VAR status: ost$status);

    pfp$verify_pva (p_info, mmc$va_read_write, status);
    IF status.normal THEN
      pfp$r2_get_attached_pf_table (p_info, status);
    IFEND;

  PROCEND pfp$get_attached_pf_table;

?? TITLE := '  [XDCL, #GATE] pfp$get_catalog_alarm_table', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_catalog_alarm_table
    (VAR p_info: pft$p_table_info;
     VAR status: ost$status);

    pfp$verify_pva (p_info, mmc$va_read_write, status);
    IF status.normal THEN
      pfp$r1_get_catalog_alarm_table (p_info, status);
    IFEND;

  PROCEND pfp$get_catalog_alarm_table;

?? TITLE := '  [XDCL, #GATE] pfp$get_catalog_segment', EJECT ??
*copy pfh$get_catalog_segment

  PROCEDURE [XDCL, #GATE] pfp$get_catalog_segment
    (    path: pft$path;
     VAR p_info: pft$p_table_info;
     VAR status: ost$status);

    CONST
      minimum_path_length = 1;

    VAR
      p_complete_path: pft$p_complete_path;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, minimum_path_length, catalog_path, p_complete_path^, status);

    IF status.normal THEN
      pfp$verify_pva (p_info, mmc$va_read_write, status);
    IFEND;

    IF status.normal THEN

    /get_catalog_segment/
      WHILE TRUE DO
        pfp$r2_get_catalog_segment (p_complete_path^, p_info, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /get_catalog_segment/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_GET_CATALOG_SEGMENT');
        IFEND;
      WHILEND /get_catalog_segment/;
    IFEND;

  PROCEND pfp$get_catalog_segment;

?? TITLE := '  [XDCL, #GATE] pfp$get_families_in_set', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_families_in_set
    (    set_name: stt$set_name;
     VAR family_list: array [1 .. * ] of ost$name;
     VAR number_of_families: 0 .. 255;
     VAR status: ost$status);

    osp$get_family_names_by_set (set_name, family_list, number_of_families, status);
  PROCEND pfp$get_families_in_set;

?? TITLE := '  [XDCL, #GATE] pfp$get_family_info', EJECT ??
*copy pfh$get_family_info

  PROCEDURE [XDCL, #GATE] pfp$get_family_info
    (    set_name: stt$set_name;
         catalog_info_selections: pft$catalog_info_selections;
     VAR p_info: pft$p_info;
     VAR status: ost$status);

    VAR
      local_set_name: stt$set_name;

    clp$validate_name (set_name, local_set_name, status.normal);
    IF NOT status.normal THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_set_name, set_name, status);
      RETURN; {----->
    IFEND;

    pfp$verify_pva (p_info, mmc$va_read_write, status);
    IF status.normal THEN
      pfp$r2_get_family_info (local_set_name, catalog_info_selections, p_info, status);
    IFEND;

  PROCEND pfp$get_family_info;
?? TITLE := '  [XDCL, #GATE] pfp$get_family_item_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_family_item_info
    (    family_name: pft$name;
         catalog_info_selections: pft$catalog_info_selections;
     VAR set_name: stt$set_name;
     VAR p_info: {i/o} pft$p_info;
     VAR status: ost$status);

    VAR
      complete_path: array [pfc$set_path_index .. pfc$family_path_index] of pft$name,
      converted_family_name: ost$family_name,
      group: pft$group,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;
    pfp$verify_pva (p_info, mmc$va_read_write, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    check_family_location (family_name, converted_family_name, served_family, served_family_locator, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF served_family THEN
      WHILE TRUE DO
        pfp$r2_df_client_get_famit_info (converted_family_name, catalog_info_selections,
              served_family_locator, set_name, p_info, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          RETURN; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_GET_FAMIT_INFO');
        IFEND;
      WHILEND;
    ELSE
      osp$get_set_name (converted_family_name, set_name, status);
      IF status.normal THEN
        group.group_type := pfc$public;
        complete_path [pfc$set_path_index] := set_name;
        complete_path [pfc$family_path_index] := converted_family_name;

        WHILE TRUE DO
          pfp$r2_get_item_info (complete_path, {system_privilege} FALSE, group, catalog_info_selections,
                $pft$file_info_selections [], p_info, status);
          IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
            RETURN; {----->
          ELSE
            pfp$catalog_access_retry_wait ('PFP$R2_GET_ITEM_INFO');
          IFEND;
        WHILEND;
      IFEND;
    IFEND;

  PROCEND pfp$get_family_item_info;

?? TITLE := '  [XDCL, #GATE] pfp$get_master_catalog_info', EJECT ??
*copy pfh$get_master_catalog_info

  PROCEDURE [XDCL, #GATE] pfp$get_master_catalog_info
    (    set_name: stt$set_name,
         family_name: pft$name;
         catalog_info_selections: pft$catalog_info_selections;
     VAR p_info: pft$p_info;
     VAR status: ost$status);

    VAR
      complete_path: array [1 .. pfc$family_path_index] of pft$name,
      converted_family_name: ost$family_name,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    pfp$verify_pva (p_info, mmc$va_read_write, status);
    IF status.normal THEN
      check_family_location (family_name, converted_family_name, served_family, served_family_locator,
            status);
    IFEND;

    IF status.normal THEN
      IF served_family THEN

      /df_client_get_mcat_info/
        WHILE TRUE DO
          pfp$r2_df_client_get_mcat_info (converted_family_name, catalog_info_selections,
                served_family_locator, p_info, status);
          IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
            EXIT /df_client_get_mcat_info/; {----->
          ELSE
            pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_GET_MCAT_INFO');
          IFEND;
        WHILEND /df_client_get_mcat_info/;
      ELSE
        convert_set_name (converted_family_name, complete_path [pfc$set_path_index], status);
        IF status.normal THEN
          complete_path [pfc$family_path_index] := converted_family_name;

        /get_master_catalog_info/
          WHILE TRUE DO
            pfp$r2_get_master_catalog_info (complete_path, catalog_info_selections, p_info, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /get_master_catalog_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_GET_MASTER_CATALOG_INFO');
            IFEND;
          WHILEND /get_master_catalog_info/;
        IFEND;
      IFEND;
    IFEND;

  PROCEND pfp$get_master_catalog_info;

?? TITLE := '  [XDCL, #GATE] pfp$get_queued_catalog_table', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_queued_catalog_table
    (VAR p_info: pft$p_table_info;
     VAR status: ost$status);

    pfp$verify_pva (p_info, mmc$va_read_write, status);
    IF status.normal THEN
      pfp$r2_get_queued_catalog_table (p_info, status);
    IFEND;

  PROCEND pfp$get_queued_catalog_table;

?? TITLE := '  [XDCL] pfp$get_restore_status', EJECT ??
*copy pfh$get_restore_status

  PROCEDURE [XDCL] pfp$get_restore_status
    (VAR restore_missing_catalogs_done: boolean);

    VAR
      p_restore_status: ^SEQ ( * ),
      restore_status: pft$retained_restore_status;

    p_restore_status := #SEQ (restore_status);
    dsp$get_data_from_rdf (dsc$rdf_restore_status, dsc$rdf_production, p_restore_status);
    restore_missing_catalogs_done := restore_status = pfc$restore_missing_cat_done;

  PROCEND pfp$get_restore_status;

?? TITLE := '  [XDCL, #GATE] pfp$get_set_list', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_set_list
    (VAR set_list: stt$set_list;
     VAR number_of_sets: stt$number_of_sets;
     VAR status: ost$status);

    status.normal := TRUE;

    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_system_administrator,
            'pfp$get_set_list', status);
      RETURN; {----->
    IFEND;

    stp$get_active_set_list (set_list, number_of_sets);
  PROCEND pfp$get_set_list;

?? TITLE := '  [XDCL, #GATE] pfp$get_stored_fmd', EJECT ??
*copy pfh$get_stored_fmd

  PROCEDURE [XDCL, #GATE] pfp$get_stored_fmd
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
     VAR catalog: boolean;
     VAR catalog_recreated: boolean;
     VAR internal_name: ost$binary_unique_name;
     VAR stored_fmd: dmt$stored_fmd;
     VAR status: ost$status);

    VAR
      p_complete_path: ^pft$complete_path;

    status.normal := TRUE;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, {minimum_path_length} pfc$family_name_index, item_path, p_complete_path^, status);

    IF status.normal THEN
      check_cycle_selector (cycle_selector, status);
    IFEND;

    IF status.normal THEN

    /get_stored_fmd/
      WHILE TRUE DO
        pfp$r2_get_stored_fmd (p_complete_path^, cycle_selector, catalog, catalog_recreated, internal_name,
              stored_fmd, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /get_stored_fmd/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_GET_STORED_FMD');
        IFEND;
      WHILEND /get_stored_fmd/;
    IFEND;

  PROCEND pfp$get_stored_fmd;

?? TITLE := '  [XDCL, #GATE] pfp$get_stored_fmd_size', EJECT ??
*copy pfh$get_stored_fmd_size

  PROCEDURE [XDCL, #GATE] pfp$get_stored_fmd_size
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
     VAR device_class: rmt$device_class;
     VAR internal_name: ost$binary_unique_name;
     VAR stored_fmd_size: dmt$stored_fmd_size;
     VAR status: ost$status);

    VAR
      p_complete_path: ^pft$complete_path;

    status.normal := TRUE;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, {minimum_path_length} pfc$family_name_index, item_path, p_complete_path^, status);

    IF status.normal THEN
      check_cycle_selector (cycle_selector, status);
    IFEND;

    IF status.normal THEN

    /get_stored_fmd_size/
      WHILE TRUE DO
        pfp$r2_get_stored_fmd_size (p_complete_path^, cycle_selector, device_class, internal_name,
              stored_fmd_size, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /get_stored_fmd_size/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_GET_STORED_FMD_SIZE');
        IFEND;
      WHILEND /get_stored_fmd_size/;
    IFEND;

  PROCEND pfp$get_stored_fmd_size;

?? TITLE := '  [XDCL, #GATE] pfp$get_volumes_in_set', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_volumes_in_set
    (    set_name: stt$set_name;
     VAR volume_list: pft$volume_list;
     VAR number_of_volumes: integer;
     VAR status: ost$status);

    VAR
      master_info: stt$volume_info,
      member_index: stt$number_of_members,
      member_list_p: ^stt$volume_list,
      number_of_members: stt$number_of_members,
      volume_index: integer;

    number_of_members := 10;
    REPEAT
      PUSH member_list_p: [1 .. number_of_members];
      stp$get_volumes_in_set (set_name, master_info, member_list_p^, number_of_members, status);
    UNTIL (NOT status.normal) OR (number_of_members <= UPPERBOUND (member_list_p^));
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF UPPERBOUND (volume_list) >= 1 THEN
      volume_list [1] := master_info.recorded_vsn;
    IFEND;
    volume_index := 2;
    member_index := 1;
    WHILE member_index <= number_of_members DO
      IF UPPERBOUND (volume_list) >= volume_index THEN
        volume_list [volume_index] := member_list_p^ [member_index].recorded_vsn;
      IFEND;
      member_index := member_index + 1;
      volume_index := volume_index + 1;
    WHILEND;

    number_of_volumes := volume_index - 1;
  PROCEND pfp$get_volumes_in_set;

?? TITLE := '  [XDCL, #GATE] pfp$get_volumes_set_name', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_volumes_set_name
    (    volume: rmt$recorded_vsn;
     VAR set_name: stt$set_name;
     VAR status: ost$status);

    stp$get_volumes_set_name (volume, set_name, status);

  PROCEND pfp$get_volumes_set_name;

?? TITLE := '  [XDCL, #GATE] pfp$no_space_movc_dest_volumes', EJECT ??
{ PURPOSE:
{   The purpose of this function is to determine whether or not all
{   destination volumes specified on the MOVE_CLASSES command are out of
{   space.

  FUNCTION [XDCL, #GATE] pfp$no_space_movc_dest_volumes
    (    move_object_info_p: ^pft$move_object_info): boolean;

    VAR
      avt_index: ost$positive_integers,
      class: char,
      entry_p: ^dmt$active_volume_table_entry,
      volume_index: ost$positive_integers;

    pfp$no_space_movc_dest_volumes := TRUE;

  /check_classes/
    FOR class := 'A' TO 'Z' DO
      IF class IN move_object_info_p^.mass_storage_class THEN

      /check_destination_volumes/
        FOR volume_index := 1 TO UPPERBOUND (move_object_info_p^.dest_volume_list_p^) DO
          IF class IN move_object_info_p^.dest_volume_list_p^ [volume_index]^.ms_class THEN

          /search_avt_for_volume/
            FOR avt_index := LOWERBOUND (dmv$active_volume_table.table_p^)
                  TO UPPERBOUND (dmv$active_volume_table.table_p^) DO
              entry_p := ^dmv$active_volume_table.table_p^ [avt_index];
              IF (NOT entry_p^.entry_available) OR (entry_p^.mass_storage.volume_unavailable) OR
                    (entry_p^.mass_storage.recorded_vsn <> move_object_info_p^.
                    dest_volume_list_p^ [volume_index]^.recorded_vsn) THEN
                CYCLE /search_avt_for_volume/; {----->
              ELSEIF NOT entry_p^.mass_storage.space_gone THEN
                pfp$no_space_movc_dest_volumes := FALSE;
                RETURN; {----->
              IFEND;
            FOREND /search_avt_for_volume/;
          IFEND;
        FOREND /check_destination_volumes/;
      IFEND;
    FOREND /check_classes/;

  FUNCEND pfp$no_space_movc_dest_volumes;

?? TITLE := '  [XDCL, #GATE] pfp$open_file_segment', EJECT ??
*copy pfh$open_file_segment

  PROCEDURE [XDCL, #GATE] pfp$open_file_segment
    (    system_file_id: gft$system_file_identifier;
         validation_ring: ost$valid_ring;
     VAR segment_pointer: mmt$segment_pointer;
     VAR status: ost$status);

    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_system_administrator,
            'pfp$open_file_segment', status);
      RETURN; {----->
    IFEND;

    mmp$open_file_segment (system_file_id, {seg_attributes_p} NIL, mmc$cell_pointer, validation_ring,
          {file_limits_to_enforce} sfc$no_limit, segment_pointer, status);
  PROCEND pfp$open_file_segment;

?? TITLE := '  [XDCL] pfp$overhaul_catalog', EJECT ??
*copy pfh$overhaul_catalog

  PROCEDURE [XDCL] pfp$overhaul_catalog
    (    path: pft$path;
         catalog_overhaul_choices: pft$catalog_overhaul_choices;
     VAR status: ost$status);

    CONST
      minimum_path_length = 2;

    VAR
      p_complete_path: pft$p_complete_path;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, minimum_path_length, catalog_path, p_complete_path^, status);
    IF status.normal THEN

    /overhaul_catalog/
      WHILE TRUE DO
        pfp$r2_overhaul_catalog (p_complete_path^, catalog_overhaul_choices, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /overhaul_catalog/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_OVERHAUL_CATALOG');
        IFEND;
      WHILEND /overhaul_catalog/;
    IFEND;

  PROCEND pfp$overhaul_catalog;

?? TITLE := '  [XDCL, #GATE] pfp$overhaul_set', EJECT ??
*copy pfh$overhaul_set

  PROCEDURE [XDCL, #GATE] pfp$overhaul_set
    (    set_name: stt$set_name;
         set_overhaul_choices: pft$set_overhaul_choices;
     VAR status: ost$status);

    VAR
      local_set_name: stt$set_name;

    clp$validate_name (set_name, local_set_name, status.normal);
    IF NOT status.normal THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_set_name, set_name, status);
      RETURN; {----->
    IFEND;

    pfp$r2_overhaul_set (local_set_name, set_overhaul_choices, status);

  PROCEND pfp$overhaul_set;

?? TITLE := '  [XDCL, #GATE] pfp$purge_master_catalog', EJECT ??
*copy pfh$purge_master_catalog

  PROCEDURE [XDCL, #GATE] pfp$purge_master_catalog
    (    set_name: stt$set_name;
         family_name: pft$name;
         master_catalog_name: pft$name;
     VAR status: ost$status);

    VAR
      caller_id: ost$caller_identifier,
      family_path: array [1 .. pfc$family_path_index] of pft$name,
      local_family_name: pft$name,
      local_master_catalog_name: pft$name,
      local_set_name: stt$set_name,
      local_status: ost$status,
      master_catalog_path: array [1 .. pfc$master_catalog_path_index] of pft$name,
      system_privilege: boolean,
      user_id: ost$user_identification,
      variant_path: pft$variant_path;

    #CALLER_ID (caller_id);

    status.normal := TRUE;

    convert_set_name (family_name, local_set_name, local_status);

    IF local_status.normal THEN
      convert_family_name (family_name, catalog_path, local_family_name, local_status);
    IFEND;

    IF local_status.normal THEN
      convert_master_catalog_name (master_catalog_name, catalog_path, local_master_catalog_name,
            local_status);
    IFEND;

    IF local_status.normal THEN
      pmp$get_user_identification (user_id, local_status);
    IFEND;

    IF local_status.normal THEN
      master_catalog_path [pfc$set_path_index] := local_set_name;
      master_catalog_path [pfc$family_path_index] := local_family_name;
      master_catalog_path [pfc$master_catalog_path_index] := local_master_catalog_name;
      {
      { The determination of system_privilege should not be based upon the
      { $system master catalog, but rather on whether the user is attempting to
      { delete his own master catalog.
      {
      system_privilege := pfp$system_privilege (caller_id.ring, jmc$system_user) AND
            (user_id.family = local_family_name) AND (user_id.user = local_master_catalog_name);

    /purge_catalog_1/
      WHILE TRUE DO
        pfp$r2_purge_catalog (master_catalog_path, system_privilege, pfc$only_if_empty, local_status);
        IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
          EXIT /purge_catalog_1/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_PURGE_CATALOG');
        IFEND;
      WHILEND /purge_catalog_1/;

      IF avp$security_option_active (avc$vso_security_audit) THEN
        variant_path.complete_path := TRUE;
        variant_path.p_complete_path := ^master_catalog_path;
        audit_catalog_deletion (variant_path, system_privilege, local_status);
      IFEND;
    IFEND;

    IF local_status.normal THEN
      family_path [pfc$set_path_index] := local_set_name;
      family_path [pfc$family_path_index] := local_family_name;

    /purge_catalog_2/
      WHILE TRUE DO
        pfp$r2_purge_catalog (family_path, system_privilege, pfc$only_if_empty, local_status);
        IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
          EXIT /purge_catalog_2/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_PURGE_CATALOG');
        IFEND;
      WHILEND /purge_catalog_2/;

      IF (local_status.normal OR (local_status.condition <> pfe$catalog_not_empty)) AND
            avp$security_option_active (avc$vso_security_audit) THEN
        variant_path.p_complete_path := ^family_path;
        audit_catalog_deletion (variant_path, system_privilege, local_status);
      IFEND;

      IF local_status.normal THEN
        osp$delete_family (local_family_name, local_status);
      IFEND;

      local_status.normal := local_status.normal OR (local_status.condition = pfe$catalog_not_empty) OR
            (local_status.condition = pfe$unknown_family);
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;

  PROCEND pfp$purge_master_catalog;

?? TITLE := '  [XDCL, #GATE] pfp$purge_object', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$purge_object
    (    path: pft$path;
     VAR status: ost$status);

    CONST
      minimum_path_length = 1;

    VAR
      p_complete_path: pft$p_complete_path;

    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_system_administrator,
            'pfp$purge_object', status);
      RETURN; {----->
    IFEND;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, minimum_path_length, catalog_path, p_complete_path^, status);

    IF status.normal THEN

    /purge_object/
      WHILE TRUE DO
        pfp$r2_purge_object (p_complete_path^, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /purge_object/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_PURGE_OBJECT');
        IFEND;
      WHILEND /purge_object/;
    IFEND;

  PROCEND pfp$purge_object;

?? TITLE := '  [XDCL, #GATE] pfp$put_catalog_media_info', EJECT ??
*copy pfh$put_catalog_media_info

  PROCEDURE [XDCL, #GATE] pfp$put_catalog_media_info
    (    path: pft$path;
         p_catalog_group: pft$p_info_record;
         set_name: stt$set_name;
     VAR restore_catalog_status: pft$restore_catalog_status;
     VAR status: ost$status);

    VAR
      local_set_name: stt$set_name,
      local_status: ost$status,
      master_info: stt$volume_info,
      member_list: ^stt$volume_list,
      number_of_members: stt$number_of_members,
      number_of_sets: stt$number_of_sets,
      p_complete_path: pft$p_complete_path,
      set_list: ^stt$set_list;

    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_system_administrator,
            'pfp$put_catalog_media_info', status);
      RETURN; {----->
    IFEND;

    local_status.normal := TRUE;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    IF UPPERBOUND (path) = pfc$family_name_index THEN
      {Restoring a family entry
      osp$get_set_name (path [pfc$family_name_index], local_set_name, local_status);
      IF NOT local_status.normal THEN
        {Family not defined -
        {Attempt to use set name from backup tape
        PUSH member_list: [1 .. 1];
        stp$get_volumes_in_set (set_name, master_info, member_list^, number_of_members, local_status);
        IF (NOT local_status.normal) AND (local_status.condition = ste$set_not_active) THEN
          { Use system set if only 1 set active or family is $system
          PUSH set_list: [1 .. 1];
          stp$get_active_set_list (set_list^, number_of_sets);
          IF (number_of_sets > 1) AND (path [pfc$family_name_index] <> jmc$system_family) THEN
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$unknown_family,
                  path [pfc$family_name_index], local_status);
          ELSE
            {Use system set name
            {Create family entry in OS table - may already exist
            local_set_name := stv$system_set_name;
            osp$add_family (path [pfc$family_name_index], local_set_name, local_status);
            local_status.normal := TRUE;
          IFEND;
        ELSEIF local_status.normal THEN
          local_set_name := set_name;
          osp$add_family (path [pfc$family_name_index], local_set_name, local_status);
          local_status.normal := TRUE;
        IFEND;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      convert_path (path, {minimum_path_length } pfc$family_name_index, catalog_path, p_complete_path^,
            local_status);
    IFEND;

    IF local_status.normal THEN
      pfp$verify_pva (p_catalog_group, mmc$va_read, local_status);
    IFEND;

    IF local_status.normal THEN

    /put_catalog_media_info/
      WHILE TRUE DO
        pfp$r2_put_catalog_media_info (p_complete_path^, p_catalog_group, restore_catalog_status,
              local_status);
        IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
          EXIT /put_catalog_media_info/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_PUT_CATALOG_MEDIA_INFO');
        IFEND;
      WHILEND /put_catalog_media_info/;
    IFEND;

    IF local_status.normal THEN
      status.normal := TRUE;
    ELSE
      status := local_status;
    IFEND;

  PROCEND pfp$put_catalog_media_info;

?? TITLE := '  [XDCL, #GATE] pfp$put_catalog_segment', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$put_catalog_segment
    (    path: pft$path;
         p_catalog_segment: ^SEQ ( * );
     VAR status: ost$status);

    CONST
      minimum_path_length = 1;

    VAR
      local_status: ost$status,
      p_complete_path: pft$p_complete_path;

    local_status.normal := TRUE;

    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_system_administrator,
            'pfp$put_catalog_segment', status);
      RETURN; {----->
    IFEND;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, minimum_path_length, catalog_path, p_complete_path^, local_status);

    IF local_status.normal THEN
      pfp$verify_pva (p_catalog_segment, mmc$va_read, local_status);
    IFEND;

    IF local_status.normal THEN

    /put_catalog_segment/
      WHILE TRUE DO
        pfp$r2_put_catalog_segment (p_complete_path^, p_catalog_segment, local_status);
        IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
          EXIT /put_catalog_segment/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_PUT_CATALOG_SEGMENT');
        IFEND;
      WHILEND /put_catalog_segment/;
    IFEND;

    IF local_status.normal THEN
      status.normal := TRUE;
    ELSE
      status := local_status;
    IFEND;
  PROCEND pfp$put_catalog_segment;

?? TITLE := '  [XDCL, #GATE] pfp$put_family_info', EJECT ??
*copy pfh$put_family_info

  PROCEDURE [XDCL, #GATE] pfp$put_family_info
    (    set_name: stt$set_name;
         family_name: pft$name;
         p_info_record: pft$p_info_record;
     VAR status: ost$status);

    VAR
      local_family_name: pft$name,
      local_set_name: stt$set_name,
      local_status: ost$status,
      master_info: stt$volume_info,
      member_list: ^stt$volume_list,
      number_of_members: stt$number_of_members,
      number_of_sets: stt$number_of_sets,
      set_list: ^stt$set_list;

    local_status.normal := TRUE;

    convert_set_name (family_name, local_set_name, local_status);
    IF NOT local_status.normal AND (local_status.condition = pfe$unknown_family) THEN
      {Family not defined -
      {Attempt to use set name from backup tape
      PUSH member_list: [1 .. 1];
      stp$get_volumes_in_set (set_name, master_info, member_list^, number_of_members, local_status);
      IF (NOT local_status.normal) AND (local_status.condition = ste$set_not_active) THEN
        { Use system set if only 1 set active or family is $system
        PUSH set_list: [1 .. 1];
        stp$get_active_set_list (set_list^, number_of_sets);
        IF (number_of_sets > 1) AND (family_name <> jmc$system_family) THEN
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$unknown_family, family_name,
                local_status);
        ELSE
          {Use system set name
          {Create family entry in OS table - may already exist
          local_set_name := stv$system_set_name;
          osp$add_family (family_name, local_set_name, local_status);
          local_status.normal := TRUE;
        IFEND;
      ELSEIF local_status.normal THEN
        local_set_name := set_name;
        osp$add_family (family_name, local_set_name, local_status);
        local_status.normal := TRUE;
      IFEND;
    IFEND;
    IF local_status.normal THEN
      convert_family_name (family_name, new_catalog_path, local_family_name, local_status);
      IF local_status.normal THEN
        pfp$verify_pva (p_info_record, mmc$va_read, local_status);
        IF local_status.normal THEN

        /put_family_info/
          WHILE TRUE DO
            pfp$r2_put_family_info (local_set_name, local_family_name, p_info_record, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /put_family_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PUT_FAMILY_INFO');
            IFEND;
          WHILEND /put_family_info/;
        IFEND;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      status.normal := TRUE;
    ELSE
      status := local_status;
    IFEND;

  PROCEND pfp$put_family_info;

?? TITLE := '  [XDCL, #GATE] pfp$put_file_media_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$put_file_media_info
    (    path: pft$path;
         p_file_group: pft$p_info_record;
         set_name: stt$set_name;
         backup_file_version: pft$backup_file_version;
     VAR file_entry_recreated: boolean;
     VAR cycles_restored_with_fmd: pft$cycle_count;
     VAR cycles_restored_without_fmd: pft$cycle_count;
     VAR status: ost$status);

    VAR
      local_status: ost$status,
      p_complete_path: pft$p_complete_path;

    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_system_administrator,
            'pfp$put_file_media_info', status);
      RETURN; {----->
    IFEND;


    local_status.normal := TRUE;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, {minimum_path_length} pfc$subcatalog_name_index, file_path, p_complete_path^,
          local_status);

    IF local_status.normal THEN
      pfp$verify_pva (p_file_group, mmc$va_read, local_status);
    IFEND;

    IF local_status.normal THEN

    /put_file_media_info/
      WHILE TRUE DO
        pfp$r2_put_file_media_info (p_complete_path^, p_file_group, backup_file_version, file_entry_recreated,
              cycles_restored_with_fmd, cycles_restored_without_fmd, local_status);
        IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
          EXIT /put_file_media_info/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_PUT_FILE_MEDIA_INFO');
        IFEND;
      WHILEND /put_file_media_info/;
    IFEND;

    IF local_status.normal THEN
      status.normal := TRUE;
    ELSE
      status := local_status;
    IFEND;

  PROCEND pfp$put_file_media_info;

?? TITLE := '  [XDCL, #GATE] pfp$put_master_catalog_info', EJECT ??
*copy pfh$put_master_catalog_info

  PROCEDURE [XDCL, #GATE] pfp$put_master_catalog_info
    (    set_name: stt$set_name;
         family_name: pft$name;
         master_catalog_name: pft$name;
         p_info_record: pft$p_info_record;
     VAR status: ost$status);

    VAR
      local_family_name: pft$name,
      local_master_catalog_name: pft$name,
      local_set_name: stt$set_name,
      local_status: ost$status;

    local_status.normal := TRUE;

    convert_set_name (family_name, local_set_name, local_status);
    IF local_status.normal THEN
      convert_family_name (family_name, catalog_path, local_family_name, local_status);
      IF local_status.normal THEN
        convert_master_catalog_name (master_catalog_name, new_catalog_path, local_master_catalog_name,
              local_status);
        IF local_status.normal THEN
          pfp$verify_pva (p_info_record, mmc$va_read, local_status);
          IF local_status.normal THEN

          /put_master_catalog_info/
            WHILE TRUE DO
              pfp$r2_put_master_catalog_info (local_set_name, local_family_name, local_master_catalog_name,
                    p_info_record, local_status);
              IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
                EXIT /put_master_catalog_info/; {----->
              ELSE
                pfp$catalog_access_retry_wait ('PFP$R2_PUT_MASTER_CATALOG_INFO');
              IFEND;
            WHILEND /put_master_catalog_info/;
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      status.normal := TRUE;
    ELSE
      status := local_status;
    IFEND;

  PROCEND pfp$put_master_catalog_info;

?? TITLE := '  [XDCL, #GATE] pfp$r3_append_rem_media_vsn', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_append_rem_media_vsn
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         volume_descriptor: rmt$volume_descriptor;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;
    osp$verify_system_privilege;

  /append_rem_media_vsn_block/
    BEGIN
      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /append_rem_media_vsn_block/; {----->
      IFEND;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /append_rem_media_vsn_block/; {----->
      IFEND;

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);
        IF status.normal THEN

        /df_client_app_rem_me_vsn/
          WHILE TRUE DO
            pfp$r2_df_client_app_rem_me_vsn (served_family_locator, p_converted_path^, cycle_selector,
                  volume_descriptor, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_app_rem_me_vsn/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_APP_REM_ME_VSN');
            IFEND;
          WHILEND /df_client_app_rem_me_vsn/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
        IF status.normal THEN

        /append_rem_media_vsn/
          WHILE TRUE DO
            pfp$r2_append_rem_media_vsn (p_complete_path^, cycle_selector, volume_descriptor, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /append_rem_media_vsn/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_APPEND_REM_MEDIA_VSN');
            IFEND;
          WHILEND /append_rem_media_vsn/;
        IFEND;
      IFEND;
    END /append_rem_media_vsn_block/;
  PROCEND pfp$r3_append_rem_media_vsn;

?? TITLE := '  [XDCL, #GATE] pfp$r3_attach', EJECT ??
*copy pfh$r3_attach

  PROCEDURE [XDCL, #GATE] pfp$r3_attach
    (    lfn: amt$local_file_name;
         path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         usage_selections: pft$usage_selections;
         share_selections: pft$share_selections;
     VAR cycle_number: fst$cycle_number;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      cycle_damage_symptoms: fst$cycle_damage_symptoms,
      global_file_name: ost$binary_unique_name,
      local_share_selections: pft$share_selections,
      local_usage_selections: pft$usage_selections,
      r2_attach_input: pft$r2_attach_in,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean;

    #CALLER_ID (caller_id);
    status.normal := TRUE;

    osp$verify_system_privilege;

    check_family_location (path [pfc$family_name_index], converted_family_name, r2_attach_input.served_family,
          served_family_locator, status);
    IF status.normal THEN
      IF r2_attach_input.served_family THEN
        r2_attach_input.served_family_locator := served_family_locator;
        PUSH r2_attach_input.p_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              r2_attach_input.p_path^, status);
      ELSE
        PUSH r2_attach_input.p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, r2_attach_input.p_complete_path^, status);
      IFEND;
    IFEND;

    IF status.normal THEN
      convert_lfn (lfn, r2_attach_input.lfn, status);
    IFEND;

    IF status.normal THEN
      check_cycle_selector (cycle_selector, status);
    IFEND;

    IF status.normal THEN
      r2_attach_input.cycle_selector := cycle_selector;
      pfi$convert_password (password, r2_attach_input.password, status);
    IFEND;

    IF status.normal THEN
      convert_usage_and_share_selects (usage_selections, share_selections, local_usage_selections,
            local_share_selections);
      IF r2_attach_input.served_family THEN
        system_privilege := pfp$system_privilege (caller_id.ring, r2_attach_input.
              p_path^ [pfc$master_catalog_name_index]);
      ELSE
        system_privilege := pfp$system_privilege (caller_id.ring, r2_attach_input.
              p_complete_path^ [pfc$master_catalog_path_index]);
      IFEND;

    /attach/
      WHILE TRUE DO
        pfp$r2_attach (r2_attach_input, update_catalog, {update_cycle_statistics} TRUE,
              local_usage_selections, local_share_selections, system_privilege,
              {validation_ring} caller_id.ring, {allowed_cycle_damage_symptoms} $fst$cycle_damage_symptoms [],
              cycle_number, cycle_damage_symptoms, global_file_name, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /attach/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_ATTACH');
        IFEND;
      WHILEND /attach/;
    IFEND;

  PROCEND pfp$r3_attach;

?? TITLE := '  [XDCL] pfp$r3_attach_or_create_file', EJECT ??
*copy pfh$r3_attach_or_create_file

  PROCEDURE [XDCL] pfp$r3_attach_or_create_file
    (    validation_ring: ost$valid_ring;
         exception_selection_info: pft$exception_selection_info;
         p_attachment_options: {input} ^fst$attachment_options;
         catalog_cycle_attributes: pft$catalog_cycle_attributes;
     VAR evaluated_file_reference: {i/o} fst$evaluated_file_reference;
     VAR allowed_access: fst$file_access_options;
     VAR selected_access: fst$file_access_options;
     VAR required_sharing: fst$file_access_options;
     VAR selected_sharing: fst$file_access_options;
     VAR action_taken: pft$attach_or_create_action;
     VAR device_class: rmt$device_class;
     VAR status: ost$status);

    VAR
      family: pft$name,
      first_path_element: fst$path_element_name,
      fs_path: fst$path,
      fs_path_size: fst$path_size,
      global_file_name: ost$binary_unique_name,
      label_used: boolean,
      master_catalog_name: pft$name,
      system_privilege: boolean,
      validation_control: t$validation_control;

    osp$verify_system_privilege;

    IF (evaluated_file_reference.number_of_path_elements > 2) OR
          (fsp$path_element (^evaluated_file_reference, 1) ^ = fsc$local) THEN
      status.normal := TRUE;
    ELSE
      clp$convert_file_ref_to_string (evaluated_file_reference, {include_open_position} FALSE, fs_path,
            fs_path_size, status);
      IF status.normal THEN
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$path_too_short, fs_path (1, fs_path_size),
              status);
        osp$append_status_integer (osc$status_parameter_delimiter, 3, radix, NOT include_radix, status);
        osp$append_status_parameter (osc$status_parameter_delimiter, 'file', status);
      IFEND;
    IFEND;

    IF status.normal
{ } AND ((catalog_cycle_attributes.site_archive_option <> pfc$null_site_archive_option)
{     } OR (catalog_cycle_attributes.site_backup_option <> pfc$null_site_backup_option)
{     } OR (catalog_cycle_attributes.site_release_option <> pfc$null_site_release_option))
{ } AND (fsp$path_element (^evaluated_file_reference, 1) ^ <> fsc$local) THEN

      first_path_element := fsp$path_element (^evaluated_file_reference, 1) ^;
      family := first_path_element (1, osc$max_name_size);
      validation_control := c$vc_not_verified;

      IF catalog_cycle_attributes.site_archive_option <> pfc$null_site_archive_option THEN
        p$validate_site_option (family, catalog_cycle_attributes.site_archive_option, c$site_archive_options,
              validation_control, status);
      IFEND;

      IF status.normal AND (catalog_cycle_attributes.site_backup_option <> pfc$null_site_archive_option) THEN
        p$validate_site_option (family, catalog_cycle_attributes.site_backup_option, c$site_backup_options,
              validation_control, status);
      IFEND;

      IF status.normal AND (catalog_cycle_attributes.site_release_option <> pfc$null_site_release_option) THEN
        p$validate_site_option (family, catalog_cycle_attributes.site_release_option, c$site_release_options,
              validation_control, status);
      IFEND;
    IFEND;

    IF status.normal THEN
      pfp$get_eval_file_ref_mast_cat (evaluated_file_reference, master_catalog_name);
      system_privilege := pfp$system_privilege (validation_ring, master_catalog_name);

    /attach_or_create_file/
      WHILE TRUE DO
        pfp$r2_attach_or_create_file (validation_ring, system_privilege, exception_selection_info,
              p_attachment_options, NIL, catalog_cycle_attributes, evaluated_file_reference,
              allowed_access, selected_access, required_sharing, selected_sharing, action_taken,
              label_used, device_class, global_file_name, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /attach_or_create_file/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_ATTACH_OR_CREATE_FILE');
        IFEND;
      WHILEND /attach_or_create_file/;
    IFEND;

  PROCEND pfp$r3_attach_or_create_file;

?? TITLE := '  [XDCL, #GATE] pfp$r3_change', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_change
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         change_list: pft$change_list;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      caller_id: ost$caller_identifier,
      change_index: ost$non_negative_integers,
      converted_family_name: ost$family_name,
      cycle_number: fst$cycle_number,
      device_class: rmt$device_class,
      local_password: pft$password,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      p_local_change_list: ^pft$change_list,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    check_cycle_selector (cycle_selector, local_status);

    IF local_status.normal THEN
      pfi$convert_password (password, local_password, local_status);
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          variant_path.complete_path := FALSE;
          variant_path.p_path := p_converted_path;
          PUSH p_local_change_list: [1 .. UPPERBOUND (change_list)];
          convert_change_list (variant_path, change_list, p_local_change_list^, local_status);
        IFEND;

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_change/
          WHILE TRUE DO
            pfp$r2_df_client_change (served_family_locator, p_converted_path^, cycle_selector, local_password,
                  system_privilege, p_local_change_list^, cycle_number, device_class, change_index,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_change/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_CHANGE');
            IFEND;
          WHILEND /df_client_change/;

          IF avp$security_option_active (avc$vso_security_audit) AND (change_index > 0) THEN
            audit_changes (variant_path, cycle_number, device_class, system_privilege, p_local_change_list^,
                  change_index, local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          variant_path.complete_path := TRUE;
          variant_path.p_complete_path := p_complete_path;
          PUSH p_local_change_list: [1 .. UPPERBOUND (change_list)];
          convert_change_list (variant_path, change_list, p_local_change_list^, local_status);
        IFEND;

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /change/
          WHILE TRUE DO
            pfp$r2_change (pfc$local_mainframe, p_complete_path^, cycle_selector, local_password,
                  system_privilege, p_local_change_list^, cycle_number, device_class, change_index,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /change/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_CHANGE');
            IFEND;
          WHILEND /change/;

          IF avp$security_option_active (avc$vso_security_audit) AND (change_index > 0) THEN
            audit_changes (variant_path, cycle_number, device_class, system_privilege, p_local_change_list^,
                  change_index, local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_change;

?? TITLE := '  [XDCL, #GATE] pfp$r3_change_catalog_flush_opt', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_change_catalog_flush_opt
    (    flush_catalogs: boolean);

    pfv$flush_catalogs := flush_catalogs;
  PROCEND pfp$r3_change_catalog_flush_opt;
?? TITLE := '  [XDCL, #GATE] pfp$r3_change_catalog_name', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_change_catalog_name
    (    evaluated_file_reference: fst$evaluated_file_reference;
         new_catalog_name: pft$name;
     VAR status: ost$status);

    VAR
      converted_family_name: ost$family_name,
      family_name: ost$family_name,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

    pfi$get_family_from_fs_struct (evaluated_file_reference, family_name);
    check_family_location (family_name, converted_family_name, served_family, served_family_locator,
          local_status);

    IF local_status.normal THEN
      IF served_family THEN
{ Not yet a served request.}
      ELSE
        PUSH p_complete_path: [1 .. evaluated_file_reference.number_of_path_elements + 1];
        pfp$convert_fs_to_complete_path (evaluated_file_reference, p_complete_path, local_status);
        IF local_status.normal THEN

        /change_catalog_name/
          WHILE TRUE DO
            pfp$r2_change_catalog_name (p_complete_path^, new_catalog_name, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /change_catalog_name/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_CHANGE_CATALOG_NAME');
            IFEND;
          WHILEND /change_catalog_name/;
        IFEND;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      status.normal := TRUE;
    ELSE
      status := local_status;
    IFEND;

  PROCEND pfp$r3_change_catalog_name;
?? TITLE := '  [XDCL, #GATE] pfp$r3_change_cycle_damage', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_change_cycle_damage
    (    file: fst$file_reference;
         password: pft$password;
         new_damage_symptoms: fst$cycle_damage_symptoms;
     VAR status: ost$status);

    CONST
      command_file_reference_allowed = TRUE,
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      converted_password: pft$password,
      cycle_selector: pft$cycle_selector,
      evaluated_file_reference: fst$evaluated_file_reference,
      family_name: ost$family_name,
      fs_path: fst$path,
      fs_path_size: fst$path_size,
      ignore_status: ost$status,
      p_complete_path: pft$p_complete_path,
      p_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    pfi$convert_password (password, converted_password, status);

    IF status.normal THEN
      fsp$evaluate_file_reference (file, NOT command_file_reference_allowed, evaluated_file_reference,
            status);
    IFEND;

    IF status.normal THEN
      pfi$convert_cycle_reference (evaluated_file_reference.cycle_reference, cycle_selector, status);
    IFEND;

    IF status.normal THEN
      IF evaluated_file_reference.number_of_path_elements < minimum_path_length THEN
        clp$convert_file_ref_to_string (evaluated_file_reference, {include_open_position} FALSE, fs_path,
              fs_path_size, ignore_status);
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$path_too_short, fs_path (1, fs_path_size),
              status);
        osp$append_status_integer (osc$status_parameter_delimiter, 3, radix, NOT include_radix, status);
        osp$append_status_parameter (osc$status_parameter_delimiter, 'file', status);
      IFEND;
    IFEND;

    IF status.normal THEN
      pfi$get_family_from_fs_struct (evaluated_file_reference, family_name);
      check_family_location (family_name, converted_family_name, served_family, served_family_locator,
            status);
    IFEND;

    IF status.normal THEN
      IF served_family THEN
        PUSH p_path: [1 .. evaluated_file_reference.number_of_path_elements];
        pfp$convert_fs_to_pft$path (evaluated_file_reference, p_path^);

      /df_client_change_cy_dam/
        WHILE TRUE DO
          pfp$r2_df_client_change_cy_dam (served_family_locator, p_path^, cycle_selector, converted_password,
                new_damage_symptoms, status);
          IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
            EXIT /df_client_change_cy_dam/; {----->
          ELSE
            pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_CHANGE_CY_DAM');
          IFEND;
        WHILEND /df_client_change_cy_dam/;
      ELSE
        PUSH p_complete_path: [1 .. evaluated_file_reference.number_of_path_elements + 1];
        pfp$convert_fs_to_complete_path (evaluated_file_reference, p_complete_path, status);
        IF status.normal THEN

        /change_cycle_damage/
          WHILE TRUE DO
            pfp$r2_change_cycle_damage (p_complete_path^, cycle_selector, converted_password,
                  new_damage_symptoms, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /change_cycle_damage/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_CHANGE_CYCLE_DAMAGE');
            IFEND;
          WHILEND /change_cycle_damage/;
        IFEND;
      IFEND;
    IFEND;
  PROCEND pfp$r3_change_cycle_damage;

?? TITLE := '  [XDCL, #GATE] pfp$r3_change_cycle_date_time', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_change_cycle_date_time
    (    file: fst$file_reference;
         password: pft$password;
         p_new_access_date_time: ^fst$date_time;
         p_new_creation_date_time: ^fst$date_time;
         p_new_modification_date_time: ^fst$date_time;
     VAR status: ost$status);

    CONST
      command_file_reference_allowed = TRUE,
      minimum_path_length = 3;

    VAR
      converted_access_date_time: pft$date_time,
      converted_creation_date_time: pft$date_time,
      converted_family_name: ost$family_name,
      converted_mod_date_time: pft$date_time,
      converted_password: pft$password,
      cycle_selector: pft$cycle_selector,
      evaluated_file_reference: fst$evaluated_file_reference,
      family_name: ost$family_name,
      fs_path: fst$path,
      fs_path_size: fst$path_size,
      ignore_status: ost$status,
      p_complete_path: pft$p_complete_path,
      p_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;
    pfi$convert_password (password, converted_password, status);

    IF status.normal THEN
      convert_date_time (p_new_access_date_time, 'new_access_date_time', converted_access_date_time, status);
    IFEND;

    IF status.normal THEN
      convert_date_time (p_new_creation_date_time, 'new_creation_date_time', converted_creation_date_time,
            status);
    IFEND;

    IF status.normal THEN
      convert_date_time (p_new_modification_date_time, 'new_modification_date_time', converted_mod_date_time,
            status);
    IFEND;

    IF status.normal THEN
      fsp$evaluate_file_reference (file, NOT command_file_reference_allowed, evaluated_file_reference,
            status);
    IFEND;

    IF status.normal THEN
      pfi$convert_cycle_reference (evaluated_file_reference.cycle_reference, cycle_selector, status);
    IFEND;

    IF status.normal THEN
      IF evaluated_file_reference.number_of_path_elements < minimum_path_length THEN
        clp$convert_file_ref_to_string (evaluated_file_reference, {include_open_position} FALSE, fs_path,
              fs_path_size, ignore_status);
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$path_too_short, fs_path (1, fs_path_size),
              status);
        osp$append_status_integer (osc$status_parameter_delimiter, 3, radix, NOT include_radix, status);
        osp$append_status_parameter (osc$status_parameter_delimiter, 'file', status);
      IFEND;
    IFEND;

    IF status.normal THEN
      pfi$get_family_from_fs_struct (evaluated_file_reference, family_name);
      check_family_location (family_name, converted_family_name, served_family, served_family_locator,
            status);
    IFEND;

    IF status.normal THEN
      IF served_family THEN
        PUSH p_path: [1 .. evaluated_file_reference.number_of_path_elements];
        pfp$convert_fs_to_pft$path (evaluated_file_reference, p_path^);

      /df_client_change_cy_dt/
        WHILE TRUE DO
          pfp$r2_df_client_change_cy_dt (served_family_locator, p_path^, cycle_selector, converted_password,
                converted_access_date_time, converted_creation_date_time, converted_mod_date_time, status);
          IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
            EXIT /df_client_change_cy_dt/; {----->
          ELSE
            pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_CHANGE_CY_DT');
          IFEND;
        WHILEND /df_client_change_cy_dt/;
      ELSE
        PUSH p_complete_path: [1 .. evaluated_file_reference.number_of_path_elements + 1];
        pfp$convert_fs_to_complete_path (evaluated_file_reference, p_complete_path, status);
        IF status.normal THEN

        /change_cycle_date_time/
          WHILE TRUE DO
            pfp$r2_change_cycle_date_time (p_complete_path^, cycle_selector, converted_password,
                  converted_access_date_time, converted_creation_date_time, converted_mod_date_time, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /change_cycle_date_time/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_CHANGE_CYCLE_DATE_TIME');
            IFEND;
          WHILEND /change_cycle_date_time/;
        IFEND;
      IFEND;
    IFEND;
  PROCEND pfp$r3_change_cycle_date_time;

?? TITLE := '  [XDCL, #GATE] pfp$r3_change_file', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_change_file
    (    file: fst$file_reference;
         password: pft$password;
         file_changes: ^fst$file_changes;
     VAR status: ost$status);

    CONST
      command_file_reference_allowed = TRUE,
      minimum_path_length = 3;

    VAR
      caller_id: ost$caller_identifier,
      change_index: ost$non_negative_integers,
      converted_family_name: ost$family_name,
      cycle_number: fst$cycle_number,
      cycle_selector: pft$cycle_selector,
      device_class: rmt$device_class,
      evaluated_file_reference: fst$evaluated_file_reference,
      family_name: ost$family_name,
      fs_path: fst$path,
      fs_path_size: fst$path_size,
      ignore_status: ost$status,
      local_password: pft$password,
      local_status: ost$status,
      p_complete_path: pft$p_complete_path,
      p_local_file_changes: ^fst$file_changes,
      p_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    pfi$convert_password (password, local_password, local_status);

    IF local_status.normal THEN
      fsp$evaluate_file_reference (file, NOT command_file_reference_allowed, evaluated_file_reference,
            local_status);
    IFEND;

    IF local_status.normal THEN
      pfi$convert_cycle_reference (evaluated_file_reference.cycle_reference, cycle_selector, local_status);
    IFEND;

    IF local_status.normal THEN
      IF evaluated_file_reference.number_of_path_elements < minimum_path_length THEN
        clp$convert_file_ref_to_string (evaluated_file_reference, {include_open_position} FALSE, fs_path,
              fs_path_size, ignore_status);
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$path_too_short, fs_path (1, fs_path_size),
              status);
        osp$append_status_integer (osc$status_parameter_delimiter, 3, radix, NOT include_radix, status);
        osp$append_status_parameter (osc$status_parameter_delimiter, 'file', status);
      IFEND;
    IFEND;

    IF local_status.normal THEN
      pfi$get_family_from_fs_struct (evaluated_file_reference, family_name);
      check_family_location (family_name, converted_family_name, served_family, served_family_locator,
            local_status);
    IFEND;

    IF local_status.normal THEN
      PUSH p_path: [1 .. evaluated_file_reference.number_of_path_elements];
      pfp$convert_fs_to_pft$path (evaluated_file_reference, p_path^);
      system_privilege := pfp$system_privilege (caller_id.ring, p_path^ [pfc$master_catalog_name_index]);
      variant_path.complete_path := FALSE;
      variant_path.p_path := p_path;
      PUSH p_local_file_changes: [1 .. UPPERBOUND (file_changes^)];
      convert_file_changes (variant_path, file_changes, p_local_file_changes, local_status);
      IF local_status.normal THEN
        system_privilege := pfp$system_privilege (caller_id.ring, p_path^ [pfc$master_catalog_name_index]);
        IF served_family THEN

        /df_client_change_file/
          WHILE TRUE DO
            pfp$r2_df_client_change_file (served_family_locator, p_path^, cycle_selector, local_password,
                  system_privilege, p_local_file_changes, cycle_number, device_class, change_index,
                  local_status);
            IF local_status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_change_file/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_CHANGE_FILE');
            IFEND;
          WHILEND /df_client_change_file/;

          IF avp$security_option_active (avc$vso_security_audit) AND (change_index > 0) THEN
            audit_file_changes (variant_path, cycle_number, device_class, system_privilege,
                  p_local_file_changes^, change_index, local_status);
          IFEND;
        ELSE
          PUSH p_complete_path: [1 .. evaluated_file_reference.number_of_path_elements + 1];
          pfp$convert_fs_to_complete_path (evaluated_file_reference, p_complete_path, local_status);
          IF local_status.normal THEN
            system_privilege := pfp$system_privilege (caller_id.ring,
                  p_path^ [pfc$master_catalog_name_index]);

          /change_file/
            WHILE TRUE DO
              pfp$r2_change_file (pfc$local_mainframe, p_complete_path^, cycle_selector, local_password,
                    system_privilege, p_local_file_changes, cycle_number, device_class, change_index,
                    local_status);
              IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
                EXIT /change_file/; {----->
              ELSE
                pfp$catalog_access_retry_wait ('PFP$R2_CHANGE_FILE');
              IFEND;
            WHILEND /change_file/;
          IFEND;

          IF avp$security_option_active (avc$vso_security_audit) AND (change_index > 0) THEN
            audit_file_changes (variant_path, cycle_number, device_class, system_privilege,
                  p_local_file_changes^, change_index, local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;
    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_change_file;

?? TITLE := '  [XDCL, #GATE] pfp$r3_change_res_to_releasable', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_change_res_to_releasable
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      converted_family_name: ost$family_name,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean;

    osp$verify_system_privilege;
    status.normal := TRUE;

    check_cycle_selector (cycle_selector, local_status);

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN

        /df_client_change_res_rel/
          WHILE TRUE DO
            pfp$r2_df_client_change_res_rel (served_family_locator, p_converted_path^, cycle_selector,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_change_res_rel/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_CHANGE_RES_REL');
            IFEND;
          WHILEND /df_client_change_res_rel/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, local_status);

        IF local_status.normal THEN

        /change_res_to_releasable/
          WHILE TRUE DO
            pfp$r2_change_res_to_releasable (p_complete_path^, cycle_selector, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /change_res_to_releasable/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_CHANGE_RES_TO_RELEASABLE');
            IFEND;
          WHILEND /change_res_to_releasable/;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_change_res_to_releasable;

?? TITLE := '  [XDCL, #GATE] pfp$r3_define', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_define
    (    lfn: amt$local_file_name;
         path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         retention: pft$retention;
         log: pft$log;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      actual_cycle: fst$cycle_number,
      audit_ownership: audit_ownership_rec,
      authority: pft$authority,
      bytes_allocated: amt$file_byte_address,
      caller_id: ost$caller_identifier,
      catalog_cycle_attributes: pft$catalog_cycle_attributes,
      converted_family_name: ost$family_name,
      local_lfn: amt$local_file_name,
      local_password: pft$password,
      local_status: ost$status,
      mainframe_id: pmt$binary_mainframe_id,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      p_dummy_buffers: ^pft$file_server_buffers,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    convert_lfn (lfn, local_lfn, local_status);

    IF local_status.normal THEN
      check_cycle_selector (cycle_selector, local_status);
    IFEND;

    IF local_status.normal THEN
      pfi$convert_password (password, local_password, local_status);
    IFEND;

    IF local_status.normal THEN
      check_retention (retention, local_status);
      IF local_status.normal THEN
        catalog_cycle_attributes.retention.selector := fsc$retention_day_increment;
        catalog_cycle_attributes.retention.day_increment := retention;
        catalog_cycle_attributes.retrieve_option := pfc$always_retrieve;
        catalog_cycle_attributes.site_archive_option := pfc$null_site_archive_option;
        catalog_cycle_attributes.site_backup_option := pfc$null_site_backup_option;
        catalog_cycle_attributes.site_release_option := pfc$null_site_release_option;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      check_log (log, local_status);
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, new_file_path,
              p_converted_path^, local_status);

        IF status.normal THEN
          variant_path.complete_path := FALSE;
          variant_path.p_path := p_converted_path;
          check_for_path_too_long (variant_path, status);
        IFEND;

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_define/
          WHILE TRUE DO
            pfp$r2_df_client_define (served_family_locator, local_lfn, p_converted_path^, cycle_selector,
                  local_password, log, catalog_cycle_attributes, system_privilege, caller_id.ring,
                  {device_class} rmc$mass_storage_device, {p_mass_storage_request_info} NIL,
                  {p_removable_media_req_info} NIL, {p_volume_list} NIL, actual_cycle, authority,
                  bytes_allocated, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_define/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DEFINE');
            IFEND;
          WHILEND /df_client_define/;

          IF local_status.normal AND (pfc$master_catalog_owner IN authority.ownership) THEN
            sfp$accumulate_file_space (sfc$perm_file_space_limit, bytes_allocated);
          IFEND;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            IF local_status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := system_privilege;
            IFEND;
            audit_cycle_creation (variant_path, cycle_selector, rmc$mass_storage_device, audit_ownership,
                  local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, new_file_path, p_complete_path^, local_status);

        IF status.normal THEN
          variant_path.complete_path := TRUE;
          variant_path.p_complete_path := p_complete_path;
          check_for_path_too_long (variant_path, status);
        IFEND;

        IF local_status.normal THEN
          p_dummy_buffers := NIL;
          pmp$get_pseudo_mainframe_id (mainframe_id);
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /define/
          WHILE TRUE DO
            pfp$r2_define (pfc$local_mainframe, mainframe_id, local_lfn, p_complete_path^, cycle_selector,
                  local_password, log, catalog_cycle_attributes, system_privilege, caller_id.ring,
                  {device_class} rmc$mass_storage_device, {p_mass_storage_request_info} NIL,
                  {p_removable_media_req_info} NIL, {p_volume_list} NIL, actual_cycle, authority,
                  bytes_allocated, p_dummy_buffers, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /define/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DEFINE');
            IFEND;
          WHILEND /define/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            IF local_status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := system_privilege;
            IFEND;
            audit_cycle_creation (variant_path, cycle_selector, rmc$mass_storage_device, audit_ownership,
                  local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_define;

?? TITLE := '  [XDCL, #GATE] pfp$r3_define_catalog', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_define_catalog
    (    path: pft$path;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$subcatalog_name_index;

    VAR
      audit_ownership: audit_ownership_rec,
      caller_id: ost$caller_identifier,
      charge_id: pft$charge_id,
      converted_family_name: ost$family_name,
      fs_path_size: fst$path_size,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      p_fs_path: ^fst$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    IF UPPERBOUND (path) <= pfc$maximum_catalog_depth THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    ELSE
      PUSH p_fs_path;
      pfp$convert_pft$path_to_fs_path (path, p_fs_path^, fs_path_size);
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$too_many_catalogs_in_path,
            p_fs_path^ (1, fs_path_size), local_status);
      osp$append_status_integer (osc$status_parameter_delimiter, pfc$maximum_catalog_depth, radix,
            NOT include_radix, local_status);
      osp$append_status_integer (osc$status_parameter_delimiter, UPPERBOUND (path), radix, NOT include_radix,
            local_status);
    IFEND;

    IF local_status.normal THEN
      pmp$get_account_project (charge_id.account, charge_id.project, local_status);
      pfp$process_unexpected_status (local_status);

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, new_catalog_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          variant_path.complete_path := FALSE;
          variant_path.p_path := p_converted_path;
          check_for_path_too_long (variant_path, local_status);
        IFEND;

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_define_catalog/
          WHILE TRUE DO
            pfp$r2_df_client_define_catalog (served_family_locator, p_converted_path^, charge_id,
                  system_privilege, {catalog_type_selected} FALSE, pfc$external_catalog,
                  {p_mass_storage_request_info} NIL, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_define_catalog/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DEFINE_CATALOG');
            IFEND;
          WHILEND /df_client_define_catalog/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            audit_ownership.ownership_known := FALSE;
            audit_ownership.system_privilege := system_privilege;
            audit_catalog_creation (variant_path, audit_ownership, local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, new_catalog_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          variant_path.complete_path := TRUE;
          variant_path.p_complete_path := p_complete_path;
          check_for_path_too_long (variant_path, local_status);
        IFEND;

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /define_catalog/
          WHILE TRUE DO
            pfp$r2_define_catalog (p_complete_path^, charge_id, system_privilege,
                  {catalog_type_selected} FALSE, pfc$external_catalog, {p_mass_storage_request_info} NIL,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /define_catalog/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DEFINE_CATALOG');
            IFEND;
          WHILEND /define_catalog/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            audit_ownership.ownership_known := FALSE;
            audit_ownership.system_privilege := system_privilege;
            audit_catalog_creation (variant_path, audit_ownership, local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_define_catalog;

?? TITLE := '  [XDCL, #GATE] pfp$r3_define_data', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_define_data
    (    lfn: amt$local_file_name;
         path: pft$path;
         cycle_selector: pft$cycle_selector;
         update_cycle_statistics: boolean;
         password_selector: pft$password_selector;
         p_mass_storage_request_info: ^fmt$mass_storage_request_info;
         p_volume_list: ^array [1 .. * ] of rmt$recorded_vsn;
         purge_cycle_options: pft$purge_cycle_options;
         replace_cycle_data: boolean;
         restore_selections: put$restore_data_selections;
     VAR mandated_modification_time: {i/o} pft$mandated_modification_time;
     VAR data_residence: pft$data_residence;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      audit_ownership: audit_ownership_rec,
      authority: pft$authority,
      bytes_allocated: amt$file_byte_address,
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      converted_file_class: rmt$mass_storage_class,
      local_lfn: amt$local_file_name,
      local_password_selector: pft$password_selector,
      mainframe_id: pmt$binary_mainframe_id,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      p_dummy_buffers: ^pft$file_server_buffers,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      variant_path: pft$variant_path;


    PROCEDURE audit_cycle_attachment
      (    variant_path: pft$variant_path;
           cycle_selector: pft$cycle_selector;
           audit_ownership: audit_ownership_rec;
           audit_status: ost$status);

      VAR
        audit_information: sft$audit_information,
        audited_object: sft$audited_fs_object_id,
        ignore_status: ost$status,
        usage_selections: pft$usage_selections;

      audit_information.audited_operation := sfc$ao_fs_attach_file;
      audited_object.variant_path := variant_path;
      audited_object.object_type := sfc$afsot_cycle;
      audited_object.cycle_selector_p := ^cycle_selector;
      audited_object.device_class := rmc$mass_storage_device;
      audit_information.attach_file.object_id_p := ^audited_object;
      IF audit_ownership.ownership_known THEN
        audit_information.attach_file.ownership := audit_ownership.ownership;
      ELSE
        pfp$get_ownership (variant_path, audit_ownership.system_privilege,
              audit_information.attach_file.ownership, ignore_status);
      IFEND;
      usage_selections := -$pft$usage_selections [];
      audit_information.attach_file.access_mode_p := ^usage_selections;
      sfp$emit_audit_statistic (audit_information, audit_status);
    PROCEND audit_cycle_attachment;


    osp$verify_system_privilege;
    #CALLER_ID (caller_id);

    convert_lfn (lfn, local_lfn, status);

    IF status.normal THEN
      check_cycle_selector (cycle_selector, status);
    IFEND;

    IF status.normal THEN
      convert_password_selector (password_selector, local_password_selector, status);
    IFEND;

    IF status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
    IFEND;

    IF status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);

        IF status.normal THEN

        /df_client_define_data/
          WHILE TRUE DO
            pfp$r2_df_client_define_data (served_family_locator, local_lfn, p_converted_path^, cycle_selector,
                  update_cycle_statistics, local_password_selector, caller_id.ring,
                  p_mass_storage_request_info, p_volume_list, purge_cycle_options, replace_cycle_data,
                  restore_selections, mandated_modification_time, data_residence, authority, bytes_allocated,
                  status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_define_data/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DEFINE_DATA');
            IFEND;
          WHILEND /df_client_define_data/;

          IF status.normal AND (pfc$master_catalog_owner IN authority.ownership) THEN
            sfp$accumulate_file_space (sfc$perm_file_space_limit, bytes_allocated);
          IFEND;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            IF status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := FALSE;
            IFEND;
            audit_cycle_attachment (variant_path, cycle_selector, audit_ownership, status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);

        IF status.normal THEN
          p_dummy_buffers := NIL;
          pmp$get_pseudo_mainframe_id (mainframe_id);

        /define_data/
          WHILE TRUE DO
            pfp$r2_define_data (pfc$local_mainframe, mainframe_id, local_lfn, p_complete_path^,
                  cycle_selector, update_cycle_statistics, local_password_selector, caller_id.ring,
                  p_mass_storage_request_info, p_volume_list, purge_cycle_options, replace_cycle_data,
                  restore_selections, mandated_modification_time, data_residence, authority, bytes_allocated,
                  p_dummy_buffers, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /define_data/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DEFINE_DATA');
            IFEND;
          WHILEND /define_data/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            IF status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := FALSE;
            IFEND;
            audit_cycle_attachment (variant_path, cycle_selector, audit_ownership, status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;
  PROCEND pfp$r3_define_data;

?? TITLE := '  [XDCL] pfp$r3_define_mass_storage', EJECT ??

  PROCEDURE [XDCL] pfp$r3_define_mass_storage
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         validation_ring: ost$valid_ring;
         log: pft$log;
         catalog_cycle_attributes: pft$catalog_cycle_attributes;
         p_mass_storage_request_info: {input} ^fmt$mass_storage_request_info;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      actual_cycle: fst$cycle_number,
      audit_ownership: audit_ownership_rec,
      authority: pft$authority,
      bytes_allocated: amt$file_byte_address,
      converted_family_name: ost$family_name,
      local_file_name: amt$local_file_name,
      local_password: pft$password,
      mainframe_id: pmt$binary_mainframe_id,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      p_dummy_buffers: ^pft$file_server_buffers,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    {
    { The last path name cannot be used for the local file name due to a
    { problem with duplicate file names in the system job when copying some
    { library files during a system upgrade.
    {
    pmp$get_unique_name (local_file_name, status);

    IF status.normal THEN
      check_cycle_selector (cycle_selector, status);
    IFEND;

    IF status.normal THEN
      pfi$convert_password (password, local_password, status);
    IFEND;

    IF status.normal THEN
      check_log (log, status);
    IFEND;

    IF status.normal THEN
      p$validate_catalog_cycle_attr (path [pfc$family_name_index], catalog_cycle_attributes, status);
    IFEND;

    IF status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
    IFEND;

    IF status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, new_file_path,
              p_converted_path^, status);

        IF status.normal THEN
          variant_path.complete_path := FALSE;
          variant_path.p_path := p_converted_path;
          check_for_path_too_long (variant_path, status);
        IFEND;

        IF status.normal THEN
          system_privilege := pfp$system_privilege (validation_ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_define/
          WHILE TRUE DO
            pfp$r2_df_client_define (served_family_locator, local_file_name, p_converted_path^,
                  cycle_selector, local_password, log, catalog_cycle_attributes, system_privilege,
                  validation_ring, rmc$mass_storage_device, p_mass_storage_request_info,
                  {p_removable_media_req_info} NIL, {p_volume_list} NIL, actual_cycle, authority,
                  bytes_allocated, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_define/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DEFINE');
            IFEND;
          WHILEND /df_client_define/;

          IF status.normal AND (pfc$master_catalog_owner IN authority.ownership) THEN
            sfp$accumulate_file_space (sfc$perm_file_space_limit, bytes_allocated);
          IFEND;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            IF status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := system_privilege;
            IFEND;
            audit_cycle_creation (variant_path, cycle_selector, rmc$mass_storage_device, audit_ownership,
                  status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, new_file_path, p_complete_path^, status);

        IF status.normal THEN
          variant_path.complete_path := TRUE;
          variant_path.p_complete_path := p_complete_path;
          check_for_path_too_long (variant_path, status);
        IFEND;

        IF status.normal THEN
          p_dummy_buffers := NIL;
          system_privilege := pfp$system_privilege (validation_ring,
                p_complete_path^ [pfc$master_catalog_path_index]);
          pmp$get_pseudo_mainframe_id (mainframe_id);

        /define/
          WHILE TRUE DO
            pfp$r2_define (pfc$local_mainframe, mainframe_id, local_file_name, p_complete_path^,
                  cycle_selector, local_password, log, catalog_cycle_attributes, system_privilege,
                  validation_ring, rmc$mass_storage_device, p_mass_storage_request_info,
                  {p_removable_media_req_info} NIL, {p_volume_list} NIL, actual_cycle, authority,
                  bytes_allocated, p_dummy_buffers, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /define/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DEFINE');
            IFEND;
          WHILEND /define/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            IF status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := system_privilege;
            IFEND;
            audit_cycle_creation (variant_path, cycle_selector, rmc$mass_storage_device, audit_ownership,
                  status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;
  PROCEND pfp$r3_define_mass_storage;

?? TITLE := '  [XDCL, #GATE] pfp$r3_define_mass_storage_cat', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_define_mass_storage_cat
    (    path: pft$path;
         catalog_type: pft$catalog_types;
         p_mass_storage_request_info: {input} ^fmt$mass_storage_request_info;
     VAR status: ost$status);

    CONST
      system_privilege = TRUE;

    VAR
      audit_ownership: audit_ownership_rec,
      charge_id: pft$charge_id,
      converted_family_name: ost$family_name,
      fs_path_size: fst$path_size,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_fs_path: ^fst$path,
      p_mass_storage_info: ^fmt$mass_storage_request_info,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    status.normal := TRUE;

    IF UPPERBOUND (path) <= pfc$maximum_catalog_depth THEN
      local_status.normal := TRUE;
    ELSE
      PUSH p_fs_path;
      pfp$convert_pft$path_to_fs_path (path, p_fs_path^, fs_path_size);
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$too_many_catalogs_in_path,
            p_fs_path^ (1, fs_path_size), local_status);
      osp$append_status_integer (osc$status_parameter_delimiter, pfc$maximum_catalog_depth, radix,
            NOT include_radix, local_status);
      osp$append_status_integer (osc$status_parameter_delimiter, UPPERBOUND (path), radix, NOT include_radix,
            local_status);
    IFEND;

    IF local_status.normal THEN
      pmp$get_account_project (charge_id.account, charge_id.project, local_status);
      pfp$process_unexpected_status (local_status);

      PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
      convert_path (path, {minimum_path_length} pfc$subcatalog_name_index, new_catalog_path, p_complete_path^,
            local_status);

      IF local_status.normal THEN
        variant_path.complete_path := TRUE;
        variant_path.p_complete_path := p_complete_path;
        check_for_path_too_long (variant_path, local_status);
      IFEND;

      IF local_status.normal THEN
        IF catalog_type = pfc$external_catalog THEN
          p_mass_storage_info := p_mass_storage_request_info;
        ELSE
          {
          { Internal catalogs are physically located within another catalog.
          { Therefore, mass storage information does not apply.
          {
          p_mass_storage_info := NIL;
        IFEND;
        {
        { Only an owner or an administrator may create a catalog.  Therefore,
        { system_privilege is never appropriate in this procedure.
        {

      /define_catalog/
        WHILE TRUE DO
          pfp$r2_define_catalog (p_complete_path^, charge_id, NOT system_privilege,
                {catalog_type_selected} TRUE, catalog_type, p_mass_storage_info, local_status);
          IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
            EXIT /define_catalog/; {----->
          ELSE
            pfp$catalog_access_retry_wait ('PFP$R2_DEFINE_CATALOG');
          IFEND;
        WHILEND /define_catalog/;

        IF avp$security_option_active (avc$vso_security_audit) THEN
          audit_ownership.ownership_known := FALSE;
          audit_ownership.system_privilege := NOT system_privilege;
          audit_catalog_creation (variant_path, audit_ownership, local_status);
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_define_mass_storage_cat;

?? TITLE := '  [XDCL] pfp$r3_define_removable_media', EJECT ??

  PROCEDURE [XDCL] pfp$r3_define_removable_media
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         validation_ring: ost$valid_ring;
         retention: pft$retention;
         log: pft$log;
         device_class: rmt$device_class;
         p_removable_media_req_info: {input} ^fmt$removable_media_req_info;
         p_volume_list: {input} ^rmt$volume_list;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      actual_cycle: fst$cycle_number,
      audit_ownership: audit_ownership_rec,
      authority: pft$authority,
      bytes_allocated: amt$file_byte_address,
      catalog_cycle_attributes: pft$catalog_cycle_attributes,
      converted_family_name: ost$family_name,
      local_file_name: amt$local_file_name,
      local_password: pft$password,
      mainframe_id: pmt$binary_mainframe_id,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      p_dummy_buffers: ^pft$file_server_buffers,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      tape_validation: boolean,
      validation_state: bat$tape_validation_state,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;

    local_file_name := path [UPPERBOUND (path)];
    check_cycle_selector (cycle_selector, status);

    IF status.normal THEN
      pfi$convert_password (password, local_password, status);
    IFEND;

    IF status.normal THEN
      check_retention (retention, status);
      IF status.normal THEN
        catalog_cycle_attributes.retention.selector := fsc$retention_day_increment;
        catalog_cycle_attributes.retention.day_increment := retention;
        catalog_cycle_attributes.retrieve_option := pfc$always_retrieve;
        catalog_cycle_attributes.site_archive_option := pfc$null_site_archive_option;
        catalog_cycle_attributes.site_backup_option := pfc$null_site_backup_option;
        catalog_cycle_attributes.site_release_option := pfc$null_site_release_option;
      IFEND;
    IFEND;

    IF status.normal THEN
      check_log (log, status);
    IFEND;

    IF status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
    IFEND;

    IF status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);

        IF status.normal THEN
          system_privilege := pfp$system_privilege (validation_ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_define/
          WHILE TRUE DO
            pfp$r2_df_client_define (served_family_locator, local_file_name, p_converted_path^,
                  cycle_selector, local_password, log, catalog_cycle_attributes, system_privilege,
                  validation_ring, device_class, {p_mass_storage_request_info} NIL,
                  p_removable_media_req_info, p_volume_list, actual_cycle, authority, bytes_allocated,
                  status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_define/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DEFINE');
            IFEND;
          WHILEND /df_client_define/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            IF status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := system_privilege;
            IFEND;
            audit_cycle_creation (variant_path, cycle_selector, device_class, audit_ownership, status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);

        IF status.normal THEN
          p_dummy_buffers := NIL;
          system_privilege := pfp$system_privilege (validation_ring,
                p_complete_path^ [pfc$master_catalog_path_index]);
          pmp$get_pseudo_mainframe_id (mainframe_id);

        /define/
          WHILE TRUE DO
            pfp$r2_define (pfc$local_mainframe, mainframe_id, local_file_name, p_complete_path^,
                  cycle_selector, local_password, log, catalog_cycle_attributes, system_privilege,
                  validation_ring, device_class, {p_mass_storage_request_info} NIL,
                  p_removable_media_req_info, p_volume_list, actual_cycle, authority, bytes_allocated,
                  p_dummy_buffers, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /define/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DEFINE');
            IFEND;
          WHILEND /define/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            IF status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := system_privilege;
            IFEND;
            audit_cycle_creation (variant_path, cycle_selector, device_class, audit_ownership, status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;
  PROCEND pfp$r3_define_removable_media;

?? TITLE := '  [XDCL, #GATE] pfp$r3_delete_all_arch_entries', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_delete_all_arch_entries
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

    check_cycle_selector (cycle_selector, status);
    IF status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF status.normal THEN
        IF served_family THEN
          PUSH p_converted_path: [1 .. UPPERBOUND (path)];
          convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
                p_converted_path^, status);
          IF status.normal THEN

          /df_client_del_all_arc_en/
            WHILE TRUE DO
              pfp$r2_df_client_del_all_arc_en (served_family_locator, p_converted_path^, cycle_selector,
                    status);
              IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
                EXIT /df_client_del_all_arc_en/; {----->
              ELSE
                pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DEL_ALL_ARC_EN');
              IFEND;
            WHILEND /df_client_del_all_arc_en/;
          IFEND;
        ELSE
          PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
          convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
          IF status.normal THEN

          /delete_all_arch_entries/
            WHILE TRUE DO
              pfp$r2_delete_all_arch_entries (p_complete_path^, cycle_selector, status);
              IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
                EXIT /delete_all_arch_entries/; {----->
              ELSE
                pfp$catalog_access_retry_wait ('PFP$R2_DELETE_ALL_ARCH_ENTRIES');
              IFEND;
            WHILEND /delete_all_arch_entries/;
          IFEND;
        IFEND;

      IFEND;
    IFEND;

  PROCEND pfp$r3_delete_all_arch_entries;

?? TITLE := '  [XDCL, #GATE] pfp$r3_delete_archive_entry', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_delete_archive_entry
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         archive_identification: pft$archive_identification;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      local_archive_identification: pft$archive_identification,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

  /delete_archive_entry_block/
    BEGIN
      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /delete_archive_entry_block/; {----->
      IFEND;

      pfp$convert_archive_ident (archive_identification, local_archive_identification, status);
      IF NOT status.normal THEN
        EXIT /delete_archive_entry_block/; {----->
      IFEND;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /delete_archive_entry_block/; {----->
      IFEND;

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);
        IF status.normal THEN

        /df_client_del_arch_entry/
          WHILE TRUE DO
            pfp$r2_df_client_del_arch_entry (served_family_locator, p_converted_path^, cycle_selector,
                  local_archive_identification, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_del_arch_entry/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DEL_ARCH_ENTRY');
            IFEND;
          WHILEND /df_client_del_arch_entry/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
        IF status.normal THEN

        /delete_archive_entry/
          WHILE TRUE DO
            pfp$r2_delete_archive_entry (p_complete_path^, cycle_selector, local_archive_identification,
                  status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /delete_archive_entry/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DELETE_ARCHIVE_ENTRY');
            IFEND;
          WHILEND /delete_archive_entry/;
        IFEND;
      IFEND;
    END /delete_archive_entry_block/;

  PROCEND pfp$r3_delete_archive_entry;

?? TITLE := '  [XDCL, #GATE] pfp$r3_delete_catalog_permit', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_delete_catalog_permit
    (    path: pft$path;
         group: pft$group;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      local_group: pft$group,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    convert_group (group, {creating_permit} FALSE, local_group, local_status);

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, catalog_path,
              p_converted_path^, local_status);
        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_delete_permit/
          WHILE TRUE DO
            pfp$r2_df_client_delete_permit (p_converted_path^, pfc$catalog_object, system_privilege,
                  local_group, served_family_locator, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_delete_permit/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DELETE_PERMIT');
            IFEND;
          WHILEND /df_client_delete_permit/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            audit_permit_deletion (variant_path, sfc$afsot_catalog, system_privilege, local_group,
                  local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, catalog_path, p_complete_path^, local_status);
        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /delete_catalog_permit/
          WHILE TRUE DO
            pfp$r2_delete_catalog_permit (p_complete_path^, system_privilege, local_group, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /delete_catalog_permit/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DELETE_CATALOG_PERMIT');
            IFEND;
          WHILEND /delete_catalog_permit/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            audit_permit_deletion (variant_path, sfc$afsot_catalog, system_privilege, local_group,
                  local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_delete_catalog_permit;

?? TITLE := '  [XDCL, #GATE] pfp$r3_delete_permit', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_delete_permit
    (    path: pft$path;
         group: pft$group;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      local_group: pft$group,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    convert_group (group, {creating_permit} FALSE, local_group, local_status);

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_delete_permit/
          WHILE TRUE DO
            pfp$r2_df_client_delete_permit (p_converted_path^, pfc$file_object, system_privilege, local_group,
                  served_family_locator, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_delete_permit/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_DELETE_PERMIT');
            IFEND;
          WHILEND /df_client_delete_permit/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            audit_permit_deletion (variant_path, sfc$afsot_file, system_privilege, local_group, local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /delete_permit/
          WHILE TRUE DO
            pfp$r2_delete_permit (p_complete_path^, system_privilege, local_group, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /delete_permit/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DELETE_PERMIT');
            IFEND;
          WHILEND /delete_permit/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            audit_permit_deletion (variant_path, sfc$afsot_file, system_privilege, local_group, local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_delete_permit;

?? TITLE := '[XDCL, #GATE] pfp$r3_flush_catalog', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_flush_catalog
    (    evaluated_file_reference: fst$evaluated_file_reference;
     VAR status: ost$status);

    VAR
      converted_family_name: ost$family_name,
      family_name: ost$family_name,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

    pfi$get_family_from_fs_struct (evaluated_file_reference, family_name);
    check_family_location (family_name, converted_family_name, served_family, served_family_locator,
          local_status);

    IF local_status.normal THEN
      IF served_family THEN
{ Not yet a served request.}
      ELSE
        PUSH p_complete_path: [1 .. evaluated_file_reference.number_of_path_elements + 1];
        pfp$convert_fs_to_complete_path (evaluated_file_reference, p_complete_path, local_status);
        IF local_status.normal THEN

        /flush_catalog/
          WHILE TRUE DO
            pfp$r2_flush_catalog (p_complete_path, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /flush_catalog/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DELETE_PERMIT');
            IFEND;
          WHILEND /flush_catalog/;
        IFEND;
      IFEND;
    IFEND;
    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;

  PROCEND pfp$r3_flush_catalog;

?? TITLE := '  [XDCL, #GATE] pfp$r3_get_family_set', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_get_family_set
    (    family_name: ost$name;
     VAR set_name: stt$set_name;
     VAR status: ost$status);

    VAR
      converted_family_name: ost$family_name,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    check_family_location (family_name, converted_family_name, served_family, served_family_locator, status);
    IF status.normal THEN
      IF served_family THEN
        pfp$r2_df_client_get_family_set (converted_family_name, served_family_locator, set_name, status);
      ELSE
        osp$get_set_name (family_name, set_name, status);
      IFEND;
    IFEND;
  PROCEND pfp$r3_get_family_set;

?? TITLE := '  [XDCL, #GATE] pfp$r3_get_item_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_get_item_info
    (    path: pft$path;
         group: pft$group;
         catalog_info_selections: pft$catalog_info_selections;
         file_info_selections: pft$file_info_selections;
     VAR p_info: {i/o} pft$p_info;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      local_group: pft$group,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean;

    #CALLER_ID (caller_id);
    status.normal := TRUE;

    osp$verify_system_privilege;

    convert_group (group, {creating_permit} FALSE, local_group, local_status);

    IF local_status.normal THEN
      pfp$verify_pva (p_info, mmc$va_read_write, local_status);
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, item_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_get_info/
          WHILE TRUE DO
            pfp$r2_df_client_get_info (pfc$get_item_info, p_converted_path^, system_privilege, local_group,
                  catalog_info_selections, file_info_selections, served_family_locator, p_info, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_get_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_GET_INFO');
            IFEND;
          WHILEND /df_client_get_info/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, item_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /get_item_info/
          WHILE TRUE DO
            pfp$r2_get_item_info (p_complete_path^, system_privilege, local_group, catalog_info_selections,
                  file_info_selections, p_info, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /get_item_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_GET_ITEM_INFO');
            IFEND;
          WHILEND /get_item_info/;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_get_item_info;

?? TITLE := '  [XDCL, #GATE] pfp$r3_get_move_obj_device_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_get_move_obj_device_info
    (    move_object_info_p: ^pft$move_object_info;
     VAR status: ost$status);

    status.normal := TRUE;

    pfp$r2_get_move_obj_device_info (move_object_info_p, status);

  PROCEND pfp$r3_get_move_obj_device_info;

?? TITLE := '  [XDCL, #GATE] pfp$r3_get_multi_item_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_get_multi_item_info
    (    path: pft$path;
         group: pft$group;
         catalog_info_selections: pft$catalog_info_selections;
         file_info_selections: pft$file_info_selections;
         p_cycle_reservation_criteria: ^pft$cycle_reservation_criteria;
     VAR p_info: {i/o} pft$p_info;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      local_group: pft$group,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean;

    #CALLER_ID (caller_id);
    status.normal := TRUE;

    osp$verify_system_privilege;

    convert_group (group, {creating_permit} FALSE, local_group, local_status);

    IF local_status.normal THEN
      pfp$verify_pva (p_info, mmc$va_read_write, local_status);
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, item_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_get_info/
          WHILE TRUE DO
            pfp$r2_df_client_get_info (pfc$get_multi_item_info, p_converted_path^, system_privilege,
                  local_group, catalog_info_selections, file_info_selections, served_family_locator, p_info,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_get_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_GET_INFO');
            IFEND;
          WHILEND /df_client_get_info/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, item_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /get_multi_item_info/
          WHILE TRUE DO
            pfp$r2_get_multi_item_info (p_complete_path^, system_privilege, local_group,
                  catalog_info_selections, file_info_selections, p_cycle_reservation_criteria, p_info,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /get_multi_item_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_GET_INFO');
            IFEND;
          WHILEND /get_multi_item_info/;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_get_multi_item_info;

?? TITLE := '  [XDCL, #GATE] pfp$r3_get_object_information', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_get_object_information
    (    evaluated_file_reference: fst$evaluated_file_reference;
         information_request: fst$goi_information_request;
         p_validation_criteria: {i/o^} ^fst$goi_validation_criteria;
     VAR p_object_information: {i/o} ^SEQ ( * );
     VAR status: ost$status);

    VAR
      caller_id: ost$caller_identifier,
      local_information_request: fst$goi_information_request,
      min_ring: ost$valid_ring,
      p_local_validation_criteria: ^fst$goi_validation_criteria,
      password_selector: pft$password_selector,
      subject_permit_count: ost$non_negative_integers,
      system_privilege: boolean,
      user_identification: ost$user_identification,
      validation_ring: ost$valid_ring;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);

    IF (evaluated_file_reference.number_of_path_elements > 1) OR
          (fsp$path_element (^evaluated_file_reference, 1) ^ = fsc$local) OR avp$system_administrator () THEN
      status.normal := TRUE;
    ELSE
      pmp$get_user_identification (user_identification, status);
      IF status.normal THEN
        IF fsp$path_element (^evaluated_file_reference, 1) ^ = user_identification.family THEN
          IF NOT avp$family_administrator () THEN
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$not_family_owner,
                  fsp$path_element (^evaluated_file_reference, 1) ^, status);
          IFEND;
        ELSE
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$unknown_family,
                fsp$path_element (^evaluated_file_reference, 1) ^, status);
        IFEND;
      IFEND;
    IFEND;

    IF status.normal THEN
      check_information_request (information_request, status);
    IFEND;

    IF status.normal THEN
      local_information_request := information_request;

      IF p_validation_criteria = NIL THEN
        p_local_validation_criteria := NIL;
        password_selector.password_specified := pfc$default_password_option;
        subject_permit_count := 0;
        min_ring := avp$ring_min ();
        IF caller_id.ring <= min_ring THEN
          validation_ring := caller_id.ring;
        ELSE
          validation_ring := min_ring;
        IFEND;
      ELSE
        pfp$verify_pva (p_validation_criteria, mmc$va_read, status);

        IF status.normal THEN
          PUSH p_local_validation_criteria: [1 .. UPPERBOUND (p_validation_criteria^)];
          convert_validation_criteria (caller_id, p_validation_criteria, p_local_validation_criteria,
                password_selector, subject_permit_count, validation_ring, status);
        IFEND;

        IF status.normal AND (subject_permit_count > 0) THEN
          pfp$verify_pva (p_validation_criteria, mmc$va_read_write, status);
        IFEND;
      IFEND;

      IF status.normal {AND (subject_permit_count > 0)} THEN
        local_information_request.catalog_depth.depth_specification := fsc$specific_depth;
        local_information_request.catalog_depth.depth := 1;
      IFEND;
    IFEND;

    IF status.normal THEN
      pfp$verify_pva (p_object_information, mmc$va_read_write, status);
    IFEND;

    IF status.normal THEN
      system_privilege := (evaluated_file_reference.number_of_path_elements > 1) AND
            pfp$system_privilege (caller_id.ring, fsp$path_element (^evaluated_file_reference, 2) ^);

    /get_object_information/
      WHILE TRUE DO
        pfp$r2_get_object_information (evaluated_file_reference, local_information_request, system_privilege,
              password_selector, subject_permit_count, validation_ring, p_local_validation_criteria,
              p_object_information, status);
        IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
          EXIT /get_object_information/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_GET_OBJECT_INFORMATION');
        IFEND;
      WHILEND /get_object_information/;
    IFEND;

    IF status.normal AND (p_local_validation_criteria <> NIL) THEN
      p_validation_criteria^ := p_local_validation_criteria^;
    IFEND;
  PROCEND pfp$r3_get_object_information;

?? TITLE := '  [XDCL, #GATE] pfp$r3_mark_release_candidate', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_mark_release_candidate
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         caller_id: ost$caller_identifier;
         archive_identification: pft$archive_identification;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      local_archive_identification: pft$archive_identification,
      local_password: pft$password,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

  /mark_release_candidate_block/
    BEGIN

      pfp$convert_archive_ident (archive_identification, local_archive_identification, status);
      IF NOT status.normal THEN
        EXIT /mark_release_candidate_block/; {----->
      IFEND;

      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /mark_release_candidate_block/; {----->
      IFEND;

      pfi$convert_password (password, local_password, status);
      IF NOT status.normal THEN
        EXIT /mark_release_candidate_block/; {----->
      IFEND;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /mark_release_candidate_block/; {----->
      IFEND;

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);
        IF status.normal THEN

        /df_client_mark_rel_cand/
          WHILE TRUE DO
            pfp$r2_df_client_mark_rel_cand (served_family_locator, p_converted_path^, cycle_selector,
                  local_password, caller_id.ring, local_archive_identification, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_mark_rel_cand/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_MARK_REL_CAND');
            IFEND;
          WHILEND /df_client_mark_rel_cand/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
        IF status.normal THEN

        /mark_release_candidate/
          WHILE TRUE DO
            pfp$r2_mark_release_candidate (p_complete_path^, cycle_selector, local_password, caller_id.ring,
                  local_archive_identification, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /mark_release_candidate/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_MARK_RELEASE_CANDIDATE');
            IFEND;
          WHILEND /mark_release_candidate/;
        IFEND;
      IFEND;
    END /mark_release_candidate_block/;

  PROCEND pfp$r3_mark_release_candidate;

?? TITLE := '  [XDCL, #GATE] pfp$r3_permit', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_permit
    (    path: pft$path;
         group: pft$group;
         permit_selections: pft$permit_selections;
         share_requirements: pft$share_requirements;
         application_info: pft$application_info;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      local_group: pft$group,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      permit_level: pft$permit_level,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    convert_group (group, {creating_permit} TRUE, local_group, local_status);

    IF local_status.normal THEN
      IF pfv$permit_level = pfc$pl_unknown THEN
        pfp$get_permit_level (permit_level, local_status);
      ELSE
        permit_level := pfv$permit_level;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_permit/
          WHILE TRUE DO
            pfp$r2_df_client_permit (p_converted_path^, pfc$file_object, system_privilege, permit_level,
                  local_group, permit_selections, share_requirements, application_info, served_family_locator,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_permit/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_PERMIT');
            IFEND;
          WHILEND /df_client_permit/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            audit_permit_creation (variant_path, sfc$afsot_file, system_privilege, local_group,
                  permit_selections, local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, local_status);
        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /permit/
          WHILE TRUE DO
            pfp$r2_permit (p_complete_path^, system_privilege, permit_level, local_group, permit_selections,
                  share_requirements, application_info, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /permit/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PERMIT');
            IFEND;
          WHILEND /permit/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            audit_permit_creation (variant_path, sfc$afsot_file, system_privilege, local_group,
                  permit_selections, local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_permit;

?? TITLE := '  [XDCL, #GATE] pfp$r3_permit_catalog', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_permit_catalog
    (    path: pft$path;
         group: pft$group;
         permit_selections: pft$permit_selections;
         share_requirements: pft$share_requirements;
         application_info: pft$application_info;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      local_group: pft$group,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      permit_level: pft$permit_level,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    convert_group (group, {creating_permit} TRUE, local_group, local_status);

    IF local_status.normal THEN
      IF pfv$permit_level = pfc$pl_unknown THEN
        pfp$get_permit_level (permit_level, local_status);
      ELSE
        permit_level := pfv$permit_level;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, catalog_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_permit/
          WHILE TRUE DO
            pfp$r2_df_client_permit (p_converted_path^, pfc$catalog_object, system_privilege, permit_level,
                  local_group, permit_selections, share_requirements, application_info, served_family_locator,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_permit/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_PERMIT');
            IFEND;
          WHILEND /df_client_permit/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            audit_permit_creation (variant_path, sfc$afsot_catalog, system_privilege, local_group,
                  permit_selections, local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, catalog_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /permit_catalog/
          WHILE TRUE DO
            pfp$r2_permit_catalog (p_complete_path^, system_privilege, permit_level, local_group,
                  permit_selections, share_requirements, application_info, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /permit_catalog/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PERMIT_CATALOG');
            IFEND;
          WHILEND /permit_catalog/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            audit_permit_creation (variant_path, sfc$afsot_catalog, system_privilege, local_group,
                  permit_selections, local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_permit_catalog;

?? TITLE := '  [XDCL, #GATE] pfp$r3_physically_move_catalog', EJECT ??
{ PURPOSE:
{   The purpose of this procedure is to call PFP$R2_PHYSICALLY_MOVE_CATALOG
{   to move a catalog to another volume for the MOVE_CLASSES command.
{

  PROCEDURE [XDCL, #GATE] pfp$r3_physically_move_catalog
    (    path: pft$path;
         move_object_info_p: ^pft$move_object_info;
     VAR status: ost$status);

    CONST
      minimum_path_length = 1;

    VAR
      converted_family_name: ost$family_name,
      ms_class: dmt$class_member,
      operator_response: pft$mo_operator_response,
      p_complete_path: pft$p_complete_path,
      retry: boolean,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

  /move_catalog/
    BEGIN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /move_catalog/; {----->
      IFEND;

      IF served_family THEN
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$unknown_family,
              path [pfc$family_name_index], status);
        EXIT /move_catalog/; {----->
      IFEND;

      PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
      convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
      IF NOT status.normal THEN
        EXIT /move_catalog/; {----->
      IFEND;

      REPEAT
        retry := FALSE;

      /physically_move_catalog/
        WHILE TRUE DO
          pfp$r2_physically_move_catalog (p_complete_path^, move_object_info_p, status);
          IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
            EXIT /physically_move_catalog/; {----->
          ELSE
            pfp$catalog_access_retry_wait ('PFP$R2_PHYSICALLY_MOVE_CATALOG');
          IFEND;
        WHILEND /physically_move_catalog/;

        IF (move_object_info_p^.move_bytes_threshold > 0) OR (NOT move_object_info_p^.wait) OR
              (NOT move_object_info_p^.perform_move) THEN
          EXIT /move_catalog/; {----->
        IFEND;

        IF (NOT move_object_info_p^.move_status.move_successful) AND
              ((move_object_info_p^.move_status.reason_for_move_failure = pfc$insufficient_space) OR
              (move_object_info_p^.move_status.reason_for_move_failure = pfc$no_available_space)) THEN
          emit_out_of_space_menu ('catalog', move_object_info_p^.set_name, path,
                move_object_info_p^.move_status.ms_class, move_object_info_p^.move_status.allocated_size,
                move_object_info_p^.move_status.reason_for_move_failure, operator_response);
          IF operator_response = pfc$retry_move THEN
            retry := TRUE;
            IF move_object_info_p^.overall_statistics.objects_not_moved > 0 THEN
              move_object_info_p^.overall_statistics.objects_not_moved :=
                    move_object_info_p^.overall_statistics.objects_not_moved - 1;
            IFEND;
            ms_class := move_object_info_p^.move_status.ms_class;
            IF move_object_info_p^.class_statistics [ms_class].objects_not_moved > 0 THEN
              move_object_info_p^.class_statistics [ms_class].objects_not_moved :=
                    move_object_info_p^.class_statistics [ms_class].objects_not_moved - 1;
            IFEND;
            IF move_object_info_p^.move_status.reason_for_move_failure = pfc$insufficient_space THEN
              IF move_object_info_p^.overall_statistics.insufficient_space > 0 THEN
                move_object_info_p^.overall_statistics.insufficient_space :=
                      move_object_info_p^.overall_statistics.insufficient_space - 1;
              IFEND;
              IF move_object_info_p^.class_statistics [ms_class].insufficient_space > 0 THEN
                move_object_info_p^.class_statistics [ms_class].insufficient_space :=
                      move_object_info_p^.class_statistics [ms_class].insufficient_space - 1;
              IFEND;
            IFEND;
            IF move_object_info_p^.move_status.reason_for_move_failure = pfc$no_available_space THEN
              IF move_object_info_p^.overall_statistics.no_available_space > 0 THEN
                move_object_info_p^.overall_statistics.no_available_space :=
                      move_object_info_p^.overall_statistics.no_available_space - 1;
              IFEND;
              IF move_object_info_p^.class_statistics [ms_class].no_available_space > 0 THEN
                move_object_info_p^.class_statistics [ms_class].no_available_space :=
                      move_object_info_p^.class_statistics [ms_class].no_available_space - 1;
              IFEND;
            IFEND;
            update_set_volume_list (move_object_info_p^.set_volume_list_p);
          ELSEIF operator_response = pfc$skip_object THEN
            move_object_info_p^.move_status.reason_for_move_failure := pfc$operator_skip;
          ELSEIF operator_response = pfc$terminate_command THEN
            move_object_info_p^.move_status.reason_for_move_failure := pfc$operator_terminate;
          IFEND;
        IFEND;
      UNTIL NOT retry;
    END /move_catalog/;

  PROCEND pfp$r3_physically_move_catalog;

?? TITLE := '  [XDCL, #GATE] pfp$r3_physically_move_cycle', EJECT ??
{ PURPOSE:
{   The purpose of this procedure is to call PFP$R2_PHYSICALLY_MOVE_CYCLE
{   to move a cycle to other volumes for the MOVE_CLASSES command.
{

  PROCEDURE [XDCL, #GATE] pfp$r3_physically_move_cycle
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         move_object_info_p: ^pft$move_object_info;
     VAR cycle_number: fst$cycle_number;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      local_cycle_selector: pft$cycle_selector,
      ms_class: dmt$class_member,
      operator_response: pft$mo_operator_response,
      p_complete_path: pft$p_complete_path,
      retry: boolean,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

  /move_cycle/
    BEGIN

      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /move_cycle/; {----->
      IFEND;
      local_cycle_selector := cycle_selector;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /move_cycle/; {----->
      IFEND;

      IF served_family THEN
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$unknown_family,
              path [pfc$family_name_index], status);
        EXIT /move_cycle/; {----->
      IFEND;

      PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
      convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
      IF NOT status.normal THEN
        EXIT /move_cycle/; {----->
      IFEND;

      REPEAT
        retry := FALSE;

      /physically_move_cycle/
        WHILE TRUE DO
          pfp$r2_physically_move_cycle (p_complete_path^, local_cycle_selector, move_object_info_p,
                cycle_number, status);
          IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
            EXIT /physically_move_cycle/; {----->
          ELSE
            pfp$catalog_access_retry_wait ('PFP$R2_PHYSICALLY_MOVE_CYCLE');
          IFEND;
        WHILEND /physically_move_cycle/;

        IF (move_object_info_p^.move_bytes_threshold > 0) OR (NOT move_object_info_p^.wait) OR
              (NOT move_object_info_p^.perform_move) THEN
          EXIT /move_cycle/; {----->
        IFEND;

        IF (NOT move_object_info_p^.move_status.move_successful) AND
              ((move_object_info_p^.move_status.reason_for_move_failure = pfc$insufficient_space) OR
              (move_object_info_p^.move_status.reason_for_move_failure = pfc$no_available_space)) THEN
          emit_out_of_space_menu ('file', move_object_info_p^.set_name, path,
                move_object_info_p^.move_status.ms_class, move_object_info_p^.move_status.allocated_size,
                move_object_info_p^.move_status.reason_for_move_failure, operator_response);
          IF operator_response = pfc$retry_move THEN
            retry := TRUE;
            IF move_object_info_p^.overall_statistics.objects_not_moved > 0 THEN
              move_object_info_p^.overall_statistics.objects_not_moved :=
                    move_object_info_p^.overall_statistics.objects_not_moved - 1;
            IFEND;
            ms_class := move_object_info_p^.move_status.ms_class;
            IF move_object_info_p^.class_statistics [ms_class].objects_not_moved > 0 THEN
              move_object_info_p^.class_statistics [ms_class].objects_not_moved :=
                    move_object_info_p^.class_statistics [ms_class].objects_not_moved - 1;
            IFEND;
            IF move_object_info_p^.move_status.reason_for_move_failure = pfc$insufficient_space THEN
              IF move_object_info_p^.overall_statistics.insufficient_space > 0 THEN
                move_object_info_p^.overall_statistics.insufficient_space :=
                      move_object_info_p^.overall_statistics.insufficient_space - 1;
              IFEND;
              IF move_object_info_p^.class_statistics [ms_class].insufficient_space > 0 THEN
                move_object_info_p^.class_statistics [ms_class].insufficient_space :=
                      move_object_info_p^.class_statistics [ms_class].insufficient_space - 1;
              IFEND;
            IFEND;
            IF move_object_info_p^.move_status.reason_for_move_failure = pfc$no_available_space THEN
              IF move_object_info_p^.overall_statistics.no_available_space > 0 THEN
                move_object_info_p^.overall_statistics.no_available_space :=
                      move_object_info_p^.overall_statistics.no_available_space - 1;
              IFEND;
              IF move_object_info_p^.class_statistics [ms_class].no_available_space > 0 THEN
                move_object_info_p^.class_statistics [ms_class].no_available_space :=
                      move_object_info_p^.class_statistics [ms_class].no_available_space - 1;
              IFEND;
            IFEND;
            update_set_volume_list (move_object_info_p^.set_volume_list_p);
          ELSEIF operator_response = pfc$skip_object THEN
            move_object_info_p^.move_status.reason_for_move_failure := pfc$operator_skip;
          ELSEIF operator_response = pfc$terminate_command THEN
            move_object_info_p^.move_status.reason_for_move_failure := pfc$operator_terminate;
          IFEND;
        IFEND;
      UNTIL NOT retry;
    END /move_cycle/;

  PROCEND pfp$r3_physically_move_cycle;

?? TITLE := '  [XDCL, #GATE] pfp$r3_purge', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_purge
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         purge_cycle_options: pft$purge_cycle_options;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      authority: pft$authority,
      audit_ownership: audit_ownership_rec,
      bytes_released: amt$file_byte_address,
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      device_class: rmt$device_class,
      local_password: pft$password,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;


    PROCEDURE audit_cycle_deletion
      (    variant_path: pft$variant_path;
           cycle_selector: pft$cycle_selector;
           device_class: rmt$device_class;
           audit_ownership: audit_ownership_rec;
           audit_status: ost$status);

      VAR
        audit_information: sft$audit_information,
        audited_object: sft$audited_fs_object_id,
        ignore_status: ost$status,
        usage_selections: pft$usage_selections;

      audit_information.audited_operation := sfc$ao_fs_delete_object;
      audited_object.variant_path := variant_path;
      audited_object.object_type := sfc$afsot_cycle;
      audited_object.cycle_selector_p := ^cycle_selector;
      audited_object.device_class := device_class;
      audit_information.delete_fs_object.object_id_p := ^audited_object;
      IF audit_ownership.ownership_known THEN
        audit_information.delete_fs_object.ownership := audit_ownership.ownership;
      ELSE
        pfp$get_ownership (variant_path, audit_ownership.system_privilege,
              audit_information.delete_fs_object.ownership, ignore_status);
      IFEND;
      sfp$emit_audit_statistic (audit_information, audit_status);
    PROCEND audit_cycle_deletion;


    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    check_cycle_selector (cycle_selector, local_status);

    IF local_status.normal THEN
      pfi$convert_password (password, local_password, local_status);
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_purge/
          WHILE TRUE DO
            pfp$r2_df_client_purge (served_family_locator, p_converted_path^, cycle_selector, password,
                  purge_cycle_options, system_privilege, caller_id.ring, authority, device_class,
                  bytes_released, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_purge/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_PURGE');
            IFEND;
          WHILEND /df_client_purge/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            IF local_status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := system_privilege;
            IFEND;
            audit_cycle_deletion (variant_path, cycle_selector, device_class, audit_ownership, local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /purge/
          WHILE TRUE DO
            pfp$r2_purge (p_complete_path^, cycle_selector, local_password, purge_cycle_options,
                  system_privilege, caller_id.ring, authority, device_class, bytes_released, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /purge/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PURGE');
            IFEND;
          WHILEND /purge/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            IF local_status.normal THEN
              audit_ownership.ownership_known := TRUE;
              audit_ownership.ownership := authority.ownership;
            ELSE
              audit_ownership.ownership_known := FALSE;
              audit_ownership.system_privilege := system_privilege;
            IFEND;
            audit_cycle_deletion (variant_path, cycle_selector, device_class, audit_ownership, local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      IF (pfc$master_catalog_owner IN authority.ownership) AND (bytes_released > 0) THEN
        sfp$accumulate_file_space (sfc$perm_file_space_limit, -bytes_released);
      IFEND;
    ELSE
      status := local_status;
    IFEND;
  PROCEND pfp$r3_purge;

?? TITLE := '  [XDCL, #GATE] pfp$r3_purge_catalog', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_purge_catalog
    (    path: pft$path;
         delete_option: pft$delete_option;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$subcatalog_name_index;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    #CALLER_ID (caller_id);
    status.normal := TRUE;

    check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
          served_family_locator, local_status);

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, catalog_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_purge_catalog/
          WHILE TRUE DO
            pfp$r2_df_client_purge_catalog (served_family_locator, p_converted_path^, system_privilege,
                  delete_option, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_purge_catalog/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_PURGE_CATALOG');
            IFEND;
          WHILEND /df_client_purge_catalog/;
          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            audit_catalog_deletion (variant_path, system_privilege, local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, catalog_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          system_privilege := pfp$system_privilege (caller_id.ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /purge_catalog/
          WHILE TRUE DO
            pfp$r2_purge_catalog (p_complete_path^, system_privilege, delete_option, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /purge_catalog/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PURGE_CATALOG');
            IFEND;
          WHILEND /purge_catalog/;
          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            audit_catalog_deletion (variant_path, system_privilege, local_status);
          IFEND;
        IFEND;
      IFEND;

      IF (NOT local_status.normal) AND (local_status.condition = pfe$path_too_short) AND
            (UPPERBOUND (path) = pfc$master_catalog_name_index) THEN
        osp$set_status_condition (pfe$cannot_purge_master_catalog, local_status);
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_purge_catalog;

?? TITLE := '  [XDCL, #GATE] pfp$r3_put_archive_entry', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_put_archive_entry
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         p_archive_array_entry: pft$p_archive_array_entry;
         p_amd: pft$p_amd;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      local_archive_identification: pft$archive_identification,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

  /put_archive_entry_block/
    BEGIN

      pfp$verify_pva (p_archive_array_entry, mmc$va_read, status);
      IF NOT status.normal THEN
        EXIT /put_archive_entry_block/; {----->
      IFEND;

      pfp$verify_pva (p_amd, mmc$va_read, status);
      IF NOT status.normal THEN
        EXIT /put_archive_entry_block/; {----->
      IFEND;

      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /put_archive_entry_block/; {----->
      IFEND;

      pfp$convert_archive_ident (p_archive_array_entry^.archive_identification, local_archive_identification,
            status);
      IF NOT status.normal THEN
        EXIT /put_archive_entry_block/; {----->
      IFEND;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /put_archive_entry_block/; {----->
      IFEND;

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);
        IF status.normal THEN

        /df_client_put_arch_entry/
          WHILE TRUE DO
            pfp$r2_df_client_put_arch_entry (served_family_locator, p_converted_path^, cycle_selector,
                  local_archive_identification, p_archive_array_entry, p_amd, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_put_arch_entry/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_PUT_ARCH_ENTRY');
            IFEND;
          WHILEND /df_client_put_arch_entry/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
        IF status.normal THEN

        /put_archive_entry/
          WHILE TRUE DO
            pfp$r2_put_archive_entry (p_complete_path^, cycle_selector, local_archive_identification,
                  p_archive_array_entry, p_amd, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /put_archive_entry/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PUT_ARCHIVE_ENTRY');
            IFEND;
          WHILEND /put_archive_entry/;
        IFEND;
      IFEND;

    END /put_archive_entry_block/;

  PROCEND pfp$r3_put_archive_entry;

?? TITLE := '  [XDCL, #GATE] pfp$r3_put_archive_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_put_archive_info
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         p_cycle_info_record: pft$p_info_record;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

  /put_archive_info_block/
    BEGIN

      pfp$verify_pva (p_cycle_info_record, mmc$va_read, status);
      IF NOT status.normal THEN
        EXIT /put_archive_info_block/; {----->
      IFEND;

      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /put_archive_info_block/; {----->
      IFEND;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /put_archive_info_block/; {----->
      IFEND;

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);
        IF status.normal THEN

        /df_client_put_arch_info/
          WHILE TRUE DO
            pfp$r2_df_client_put_arch_info (served_family_locator, p_converted_path^, cycle_selector,
                  p_cycle_info_record, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_put_arch_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_PUT_ARCH_INFO');
            IFEND;
          WHILEND /df_client_put_arch_info/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
        IF status.normal THEN

        /put_archive_info/
          WHILE TRUE DO
            pfp$r2_put_archive_info (p_complete_path^, cycle_selector, p_cycle_info_record, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /put_archive_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PUT_ARCHIVE_INFO');
            IFEND;
          WHILEND /put_archive_info/;
        IFEND;
      IFEND;

    END /put_archive_info_block/;

  PROCEND pfp$r3_put_archive_info;

?? TITLE := '  [XDCL, #GATE] pfp$r3_put_cycle_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_put_cycle_info
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         password_selector: pft$password_selector;
         cycle_array_entry: pft$cycle_array_entry_version_2;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      converted_family_name: ost$family_name,
      local_password_selector: pft$password_selector,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      variant_path: pft$variant_path;


    PROCEDURE audit_cycle_restoration
      (    variant_path: pft$variant_path;
           cycle_selector: pft$cycle_selector;
           device_class: rmt$device_class;
           audit_status: ost$status);

      CONST
        system_privilege = TRUE;

      VAR
        audit_information: sft$audit_information,
        audited_object: sft$audited_fs_object_id,
        ignore_status: ost$status;

      audit_information.audited_operation := sfc$ao_fs_create_object;
      audited_object.variant_path := variant_path;
      audited_object.object_type := sfc$afsot_cycle;
      audited_object.cycle_selector_p := ^cycle_selector;
      audited_object.device_class := device_class;
      audit_information.create_fs_object.object_id_p := ^audited_object;
      pfp$get_ownership (variant_path, NOT system_privilege, audit_information.create_fs_object.ownership,
            ignore_status);
      sfp$emit_audit_statistic (audit_information, audit_status);
    PROCEND audit_cycle_restoration;


    status.normal := TRUE;

    check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
          served_family_locator, local_status);

    IF local_status.normal THEN
      check_cycle_selector (cycle_selector, local_status);
    IFEND;

    IF local_status.normal THEN
      convert_password_selector (password_selector, local_password_selector, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN

        /df_client_put_cycle_info/
          WHILE TRUE DO
            pfp$r2_df_client_put_cycle_info (served_family_locator, p_converted_path^, cycle_selector,
                  local_password_selector, cycle_array_entry, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_put_cycle_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_PUT_CYCLE_INFO');
            IFEND;
          WHILEND /df_client_put_cycle_info/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            audit_cycle_restoration (variant_path, cycle_selector, cycle_array_entry.device_class,
                  local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, local_status);

        IF local_status.normal THEN

        /put_cycle_info/
          WHILE TRUE DO
            pfp$r2_put_cycle_info (p_complete_path^, cycle_selector, local_password_selector,
                  cycle_array_entry, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /put_cycle_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PUT_CYCLE_INFO');
            IFEND;
          WHILEND /put_cycle_info/;

          IF avp$security_option_active (avc$vso_security_audit) THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            audit_cycle_restoration (variant_path, cycle_selector, cycle_array_entry.device_class,
                  local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_put_cycle_info;

?? TITLE := '  [XDCL, #GATE] pfp$r3_put_item_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_put_item_info
    (    path: pft$path;
         p_info_record: {input} pft$p_info_record;
         restore_archive_information: boolean;
         selection_criteria: put$selection_criteria;
         backup_file_version: pft$backup_file_version;
     VAR all_permits_restored: boolean;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1,
      system_privilege = TRUE;

    VAR
      audit_ownership: audit_ownership_rec,
      audit_restorations: boolean,
      converted_family_name: ost$family_name,
      local_status: ost$status,
      ownership: pft$ownership,
      p_auditable_cycles: ^pft$auditable_cycles,
      p_auditable_permits: ^pft$auditable_permits,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      p_cycle_array_version_1: ^pft$cycle_array,
      p_cycle_array_version_2: ^pft$cycle_array_version_2,
      p_group_info_record: ^pft$info_record,
      p_ignore_status: ^ost$status,
      p_permit_array: ^pft$permit_array,
      permit_level: pft$permit_level,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      variant_path: pft$variant_path;

    all_permits_restored := TRUE;
    status.normal := TRUE;

    pfp$verify_pva (p_info_record, mmc$va_read, local_status);

    IF local_status.normal THEN
      IF pfv$permit_level = pfc$pl_unknown THEN
        pfp$get_permit_level (permit_level, local_status);
      ELSE
        permit_level := pfv$permit_level;
      IFEND;
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      audit_restorations := sfp$auditing_operation (sfc$ao_fs_create_object) OR
            sfp$auditing_operation (sfc$ao_fs_create_permit);

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, new_item_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          variant_path.complete_path := FALSE;
          variant_path.p_path := p_converted_path;
          check_for_path_too_long (variant_path, local_status);
        IFEND;

        IF local_status.normal THEN
          IF audit_restorations THEN
            pfp$locate_group_info_record (p_info_record, p_group_info_record, local_status);

            IF local_status.normal THEN
              pfp$find_permit_array (p_group_info_record, p_permit_array, local_status);
            IFEND;

            IF local_status.normal THEN
              IF p_permit_array = NIL THEN
                p_auditable_permits := NIL;
              ELSE
                PUSH p_auditable_permits: [1 .. UPPERBOUND (p_permit_array^)];
              IFEND;

              IF p_group_info_record^.record_type = pfc$catalog_group_record THEN
                p_auditable_cycles := NIL;
              ELSE {pfc$file_group_record}
                IF backup_file_version = pfc$backup_file_version_2 THEN
                  pfp$find_cycle_array_version_2 (p_group_info_record, p_cycle_array_version_2, local_status);

                  IF local_status.normal THEN
                    IF p_cycle_array_version_2 = NIL THEN
                      p_auditable_cycles := NIL;
                    ELSE
                      PUSH p_auditable_cycles: [1 .. UPPERBOUND (p_cycle_array_version_2^)];
                    IFEND;
                  IFEND;
                ELSE {pfc$backup_file_version_1}
                  pfp$find_cycle_array (p_group_info_record, p_cycle_array_version_1, local_status);

                  IF local_status.normal THEN
                    IF p_cycle_array_version_1 = NIL THEN
                      p_auditable_cycles := NIL;
                    ELSE
                      PUSH p_auditable_cycles: [1 .. UPPERBOUND (p_cycle_array_version_1^)];
                    IFEND;
                  IFEND;
                IFEND;
              IFEND;
            IFEND;
          ELSE
            p_auditable_permits := NIL;
            p_auditable_cycles := NIL;
          IFEND;
        IFEND;

        IF local_status.normal THEN

        /df_client_put_item_info/
          WHILE TRUE DO
            pfp$r2_df_client_put_item_info (backup_file_version, p_info_record, served_family_locator,
                  p_converted_path^, permit_level, selection_criteria, restore_archive_information,
                  audit_restorations, all_permits_restored, p_auditable_permits, p_auditable_cycles,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_put_item_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_PUT_ITEM_INFO');
            IFEND;
          WHILEND /df_client_put_item_info/;

          IF (p_auditable_permits <> NIL) OR (p_auditable_cycles <> NIL) THEN
            PUSH p_ignore_status;
            pfp$get_ownership (variant_path, NOT system_privilege, ownership, p_ignore_status^);

            IF p_group_info_record^.record_type = pfc$catalog_group_record THEN
              IF p_auditable_permits <> NIL THEN
                audit_permit_restorations (variant_path, sfc$afsot_catalog, ownership, p_auditable_permits^);
              IFEND;

              IF audit_restorations THEN
                audit_ownership.ownership_known := TRUE;
                audit_ownership.ownership := ownership;
                audit_catalog_creation (variant_path, audit_ownership, local_status);
              IFEND;
            ELSE {pfc$file_group_record}
              IF p_auditable_permits <> NIL THEN
                audit_permit_restorations (variant_path, sfc$afsot_file, ownership, p_auditable_permits^);
              IFEND;

              IF p_auditable_cycles <> NIL THEN
                audit_cycle_restorations (variant_path, ownership, p_auditable_cycles^);
              IFEND;
            IFEND;
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, new_item_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          variant_path.complete_path := TRUE;
          variant_path.p_complete_path := p_complete_path;
          check_for_path_too_long (variant_path, local_status);
        IFEND;

        IF local_status.normal THEN
          p_auditable_permits := NIL;
          p_auditable_cycles := NIL;

        /put_item_info/
          WHILE TRUE DO
            pfp$r2_put_item_info (backup_file_version, p_info_record, pfc$local_mainframe, p_complete_path^,
                  permit_level, selection_criteria, restore_archive_information, audit_restorations,
                  all_permits_restored, p_auditable_permits, p_auditable_cycles, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /put_item_info/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_PUT_ITEM_INFO');
            IFEND;
          WHILEND /put_item_info/;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_put_item_info;

?? TITLE := '  [XDCL, #GATE] pfp$r3_release_data', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_release_data
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         p_release_data_info: {i/o} ^pft$release_data_info;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      local_password: pft$password,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

  /release_data_block/
    BEGIN
      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /release_data_block/; {----->
      IFEND;

      pfi$convert_password (password, local_password, status);
      IF NOT status.normal THEN
        EXIT /release_data_block/; {----->
      IFEND;

      IF p_release_data_info <> NIL THEN
        pfp$verify_pva (p_release_data_info, mmc$va_read_write, status);
        IF NOT status.normal THEN
          EXIT /release_data_block/; {----->
        IFEND;
      IFEND;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /release_data_block/; {----->
      IFEND;

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);
        IF status.normal THEN

        /df_client_release_data/
          WHILE TRUE DO
            pfp$r2_df_client_release_data (served_family_locator, p_converted_path^, cycle_selector,
                  local_password, p_release_data_info, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_release_data/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_RELEASE_DATA');
            IFEND;
          WHILEND /df_client_release_data/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
        IF status.normal THEN

        /release_data/
          WHILE TRUE DO
            pfp$r2_release_data (p_complete_path^, cycle_selector, local_password, p_release_data_info,
                  status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /release_data/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_RELEASE_DATA');
            IFEND;
          WHILEND /release_data/;
        IFEND;
      IFEND;
    END /release_data_block/;

  PROCEND pfp$r3_release_data;

?? TITLE := '  [XDCL, #GATE] pfp$r3_replace_archive_entry', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_replace_archive_entry
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         archive_identification: pft$archive_identification;
         p_archive_array_entry: pft$p_archive_array_entry;
         p_amd: pft$p_amd;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      local_archive_identification: pft$archive_identification,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

  /replace_archive_entry_block/
    BEGIN

      pfp$verify_pva (p_archive_array_entry, mmc$va_read, status);
      IF NOT status.normal THEN
        EXIT /replace_archive_entry_block/; {----->
      IFEND;

      pfp$verify_pva (p_amd, mmc$va_read, status);
      IF NOT status.normal THEN
        EXIT /replace_archive_entry_block/; {----->
      IFEND;

      pfp$convert_archive_ident (archive_identification, local_archive_identification, status);
      IF NOT status.normal THEN
        EXIT /replace_archive_entry_block/; {----->
      IFEND;

      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /replace_archive_entry_block/; {----->
      IFEND;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /replace_archive_entry_block/; {----->
      IFEND;

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);
        IF status.normal THEN

        /df_client_rep_arch_entry/
          WHILE TRUE DO
            pfp$r2_df_client_rep_arch_entry (served_family_locator, p_converted_path^, cycle_selector,
                  local_archive_identification, p_archive_array_entry, p_amd, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_rep_arch_entry/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_REP_ARCH_ENTRY');
            IFEND;
          WHILEND /df_client_rep_arch_entry/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
        IF status.normal THEN

        /replace_archive_entry/
          WHILE TRUE DO
            pfp$r2_replace_archive_entry (p_complete_path^, cycle_selector, local_archive_identification,
                  p_archive_array_entry, p_amd, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /replace_archive_entry/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_REPLACE_ARCHIVE_ENTRY');
            IFEND;
          WHILEND /replace_archive_entry/;
        IFEND;
      IFEND;

    END /replace_archive_entry_block/;

  PROCEND pfp$r3_replace_archive_entry;

?? TITLE := '  [XDCL, #GATE] pfp$r3_replace_rem_media_fmd', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_replace_rem_media_fmd
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         password_selector: pft$password_selector;
         replace_existing_rem_media_fmd: boolean;
         p_file_media_descriptor: {input} ^SEQ ( * );
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      converted_family_name: ost$family_name,
      converted_password_selector: pft$password_selector,
      p_complete_path: pft$p_complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator;

    status.normal := TRUE;

  /replace_rem_media_fmd_block/
    BEGIN
      check_cycle_selector (cycle_selector, status);
      IF NOT status.normal THEN
        EXIT /replace_rem_media_fmd_block/; {----->
      IFEND;

      convert_password_selector (password_selector, converted_password_selector, status);
      IF NOT status.normal THEN
        EXIT /replace_rem_media_fmd_block/; {----->
      IFEND;

      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, status);
      IF NOT status.normal THEN
        EXIT /replace_rem_media_fmd_block/; {----->
      IFEND;

      pfp$verify_pva (p_file_media_descriptor, mmc$va_read, status);
      IF NOT status.normal THEN
        EXIT /replace_rem_media_fmd_block/; {----->
      IFEND;

      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, status);
        IF status.normal THEN

        /df_client_rep_rem_me_fmd/
          WHILE TRUE DO
            pfp$r2_df_client_rep_rem_me_fmd (served_family_locator, p_converted_path^, cycle_selector,
                  converted_password_selector, replace_existing_rem_media_fmd, p_file_media_descriptor,
                  status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_rep_rem_me_fmd/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_REP_REM_ME_FMD');
            IFEND;
          WHILEND /df_client_rep_rem_me_fmd/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, status);
        IF status.normal THEN

        /replace_rem_media_fmd/
          WHILE TRUE DO
            pfp$r2_replace_rem_media_fmd (p_complete_path^, cycle_selector, converted_password_selector,
                  replace_existing_rem_media_fmd, p_file_media_descriptor, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /replace_rem_media_fmd/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_REPLACE_REM_MEDIA_FMD');
            IFEND;
          WHILEND /replace_rem_media_fmd/;
        IFEND;
      IFEND;
    END /replace_rem_media_fmd_block/;
  PROCEND pfp$r3_replace_rem_media_fmd;

?? TITLE := '  [XDCL, #GATE] pfp$r3_resolve_path', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_resolve_path
    (    path: pft$path;
     VAR cycle_reference: {i/o} fst$cycle_reference;
     VAR path_resolution: fst$path_resolution;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$family_name_index;

    VAR
      converted_family_name: ost$family_name,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      system_privilege: boolean;

    { This procedure is called by pup$fetch_backup_information, as well as
    { elsewhere, which executes in the user's ring.  Hence, system_privilege
    { must not be determined using the caller's ring.  This procedure must not
    { be called directly by the user, though.
    {
    osp$verify_system_privilege;

    check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
          served_family_locator, status);

    IF status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, item_path,
              p_converted_path^, status);

        IF status.normal THEN
          system_privilege := pfp$system_privilege (osc$tsrv_ring,
                p_converted_path^ [pfc$master_catalog_name_index]);

        /df_client_resolve/
          WHILE TRUE DO
            pfp$r2_df_client_resolve (path, served_family_locator, system_privilege, cycle_reference,
                  path_resolution, status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_resolve/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_REPLACE_REM_MEDIA_FMD');
            IFEND;
          WHILEND /df_client_resolve/;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, item_path, p_complete_path^, status);

        IF status.normal THEN
          system_privilege := pfp$system_privilege (osc$tsrv_ring,
                p_complete_path^ [pfc$master_catalog_path_index]);

        /resolve_path/
          WHILE TRUE DO
            pfp$r2_resolve_path (p_complete_path^, system_privilege, cycle_reference, path_resolution,
                  status);
            IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
              EXIT /resolve_path/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_RESOLVE_PATH');
            IFEND;
          WHILEND /resolve_path/;
        IFEND;
      IFEND;
    IFEND;
  PROCEND pfp$r3_resolve_path;

?? TITLE := '  [XDCL, #GATE] pfp$r3_save_released_file_label', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_save_released_file_label
    (    path: pft$path;
         cycle_selector: pft$cycle_selector;
         update_cycle_statistics: boolean;
         password_selector: pft$password_selector;
         p_file_label: {input^} fmt$p_file_label;
     VAR status: ost$status);

    CONST
      minimum_path_length = pfc$master_catalog_name_index + 1;

    VAR
      converted_family_name: ost$family_name,
      converted_password_selector: pft$password_selector,
      local_status: ost$status,
      p_complete_path: ^pft$complete_path,
      p_converted_path: ^pft$path,
      p_save_label_audit_info: ^pft$save_label_audit_info,
      served_family: boolean,
      served_family_locator: pft$served_family_locator,
      variant_path: pft$variant_path;

    osp$verify_system_privilege;
    status.normal := TRUE;

    check_cycle_selector (cycle_selector, local_status);

    IF local_status.normal THEN
      convert_password_selector (password_selector, converted_password_selector, local_status);
    IFEND;

    IF local_status.normal THEN
      check_family_location (path [pfc$family_name_index], converted_family_name, served_family,
            served_family_locator, local_status);
    IFEND;

    IF local_status.normal THEN
      pfp$verify_pva (p_file_label, mmc$va_read, local_status);
    IFEND;

    IF local_status.normal THEN
      IF served_family THEN
        PUSH p_converted_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              p_converted_path^, local_status);

        IF local_status.normal THEN
          IF sfp$auditing_operation (sfc$ao_fs_change_attribute) THEN
            PUSH p_save_label_audit_info;
          ELSE
            p_save_label_audit_info := NIL;
          IFEND;

        /df_client_save_rel_label/
          WHILE TRUE DO
            pfp$r2_df_client_save_rel_label (served_family_locator, p_converted_path^, cycle_selector,
                  converted_password_selector, p_file_label, avp$ring_min (), update_cycle_statistics,
                  p_save_label_audit_info, local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /df_client_save_rel_label/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_DF_CLIENT_SAVE_REL_LABEL');
            IFEND;
          WHILEND /df_client_save_rel_label/;

          IF p_save_label_audit_info <> NIL THEN
            variant_path.complete_path := FALSE;
            variant_path.p_path := p_converted_path;
            pfp$audit_save_label (variant_path, p_save_label_audit_info, local_status);
          IFEND;
        IFEND;
      ELSE
        PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, p_complete_path^, local_status);

        IF local_status.normal THEN
          IF sfp$auditing_operation (sfc$ao_fs_change_attribute) THEN
            PUSH p_save_label_audit_info;
          ELSE
            p_save_label_audit_info := NIL;
          IFEND;

        /save_released_file_label/
          WHILE TRUE DO
            pfp$r2_save_released_file_label (p_complete_path^, cycle_selector, converted_password_selector,
                  p_file_label, avp$ring_min (), update_cycle_statistics, p_save_label_audit_info,
                  local_status);
            IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
              EXIT /save_released_file_label/; {----->
            ELSE
              pfp$catalog_access_retry_wait ('PFP$R2_SAVE_RELEASED_FILE_LABEL');
            IFEND;
          WHILEND /save_released_file_label/;

          IF p_save_label_audit_info <> NIL THEN
            variant_path.complete_path := TRUE;
            variant_path.p_complete_path := p_complete_path;
            pfp$audit_save_label (variant_path, p_save_label_audit_info, local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_save_released_file_label;

?? TITLE := '  [XDCL, #GATE] pfp$r3_utility_attach', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$r3_utility_attach
    (    lfn: amt$local_file_name;
         path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         usage_selections: pft$usage_selections;
         share_selections: pft$share_selections;
         allowed_cycle_damage_symptoms: fst$cycle_damage_symptoms;
     VAR cycle_damage_symptoms: fst$cycle_damage_symptoms;
     VAR cycle_number: fst$cycle_number;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3;

    VAR
      caller_id: ost$caller_identifier,
      converted_family_name: ost$family_name,
      global_file_name: ost$binary_unique_name,
      local_share_selections: pft$share_selections,
      local_status: ost$status,
      local_usage_selections: pft$usage_selections,
      r2_attach_input: pft$r2_attach_in,
      system_privilege: boolean;

    #CALLER_ID (caller_id);
    status.normal := TRUE;

    osp$verify_system_privilege;

    check_family_location (path [pfc$family_name_index], converted_family_name, r2_attach_input.served_family,
          r2_attach_input.served_family_locator, local_status);
    IF local_status.normal THEN
      IF r2_attach_input.served_family THEN
        PUSH r2_attach_input.p_path: [1 .. UPPERBOUND (path)];
        convert_path_without_set (path, converted_family_name, minimum_path_length, file_path,
              r2_attach_input.p_path^, local_status);
      ELSE
        PUSH r2_attach_input.p_complete_path: [1 .. UPPERBOUND (path) + 1];
        convert_path (path, minimum_path_length, file_path, r2_attach_input.p_complete_path^, local_status);
      IFEND;
    IFEND;

    IF local_status.normal THEN
      convert_lfn (lfn, r2_attach_input.lfn, local_status);
    IFEND;

    IF local_status.normal THEN
      check_cycle_selector (cycle_selector, local_status);
    IFEND;

    IF local_status.normal THEN
      r2_attach_input.cycle_selector := cycle_selector;
      pfi$convert_password (password, r2_attach_input.password, local_status);
    IFEND;

    IF local_status.normal THEN
      convert_usage_and_share_selects (usage_selections, share_selections, local_usage_selections,
            local_share_selections);
      IF r2_attach_input.served_family THEN
        system_privilege := pfp$system_privilege (caller_id.ring, r2_attach_input.
              p_path^ [pfc$master_catalog_name_index]);
      ELSE
        system_privilege := pfp$system_privilege (caller_id.ring, r2_attach_input.
              p_complete_path^ [pfc$master_catalog_path_index]);
      IFEND;

    /attach/
      WHILE TRUE DO
        pfp$r2_attach (r2_attach_input, update_catalog, {update_cycle_statistics} FALSE,
              local_usage_selections, local_share_selections, system_privilege,
              {validation_ring} caller_id.ring, allowed_cycle_damage_symptoms, cycle_number,
              cycle_damage_symptoms, global_file_name, local_status);
        IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
          EXIT /attach/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_ATTACH');
        IFEND;
      WHILEND /attach/;

    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;
  PROCEND pfp$r3_utility_attach;

?? TITLE := '  [XDCL] pfp$recreate_system_catalog', EJECT ??

  PROCEDURE [XDCL] pfp$recreate_system_catalog
    (VAR status: ost$status);

    pfp$r2_recreate_system_catalog (status);
  PROCEND pfp$recreate_system_catalog;

?? TITLE := '  [XDCL] pfp$restricted_attach', EJECT ??
*copy pfh$restricted_attach

  PROCEDURE [XDCL] pfp$restricted_attach
    (    lfn: amt$local_file_name;
         path: pft$path;
         cycle_selector: pft$cycle_selector;
         password: pft$password;
         usage_selections: pft$usage_selections;
         share_selections: pft$share_selections;
     VAR cycle_number: fst$cycle_number;
     VAR status: ost$status);

    VAR
      caller_id: ost$caller_identifier,
      cycle_damage_symptoms: fst$cycle_damage_symptoms,
      global_file_name: ost$binary_unique_name,
      local_share_selections: pft$share_selections,
      local_status: ost$status,
      local_usage_selections: pft$usage_selections,
      r2_attach_input: pft$r2_attach_in;

    #CALLER_ID (caller_id);
    status.normal := TRUE;

    osp$verify_system_privilege;

    r2_attach_input.served_family := FALSE;
    PUSH r2_attach_input.p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, {minimum_path_length} 3, file_path, r2_attach_input.p_complete_path^, local_status);

    IF local_status.normal THEN
      convert_lfn (lfn, r2_attach_input.lfn, local_status);
    IFEND;

    IF local_status.normal THEN
      check_cycle_selector (cycle_selector, local_status);
    IFEND;

    IF local_status.normal THEN
      r2_attach_input.cycle_selector := cycle_selector;
      pfi$convert_password (password, r2_attach_input.password, local_status);
    IFEND;

    IF local_status.normal THEN
      convert_usage_and_share_selects (usage_selections, share_selections, local_usage_selections,
            local_share_selections);
      {
      { This procedure is only called by job recovery.  Hence, system_privilege
      { is always appropriate in this procedure.
      {

    /attach/
      WHILE TRUE DO
        pfp$r2_attach (r2_attach_input, NOT update_catalog, {update_cycle_statistics} FALSE,
              local_usage_selections, local_share_selections, {system_privilege} TRUE,
              {validation_ring} caller_id.ring, {allowed_cycle_damage_symptoms} $fst$cycle_damage_symptoms [],
              cycle_number, cycle_damage_symptoms, global_file_name, local_status);
        IF local_status.normal OR (local_status.condition <> pfe$catalog_access_retry) THEN
          EXIT /attach/; {----->
        ELSE
          pfp$catalog_access_retry_wait ('PFP$R2_SAVE_RELEASED_FILE_LABEL');
        IFEND;
      WHILEND /attach/;
    IFEND;

    IF NOT local_status.normal THEN
      status := local_status;
    IFEND;

  PROCEND pfp$restricted_attach;

?? TITLE := '  [XDCL, #GATE] pfp$set_restore_status', EJECT ??
*copy pfh$set_restore_status

  PROCEDURE [XDCL, #GATE] pfp$set_restore_status
    (    restore_missing_catalogs_done: boolean;
     VAR status: ost$status);

    VAR
      p_restore_status: ^SEQ ( * ),
      restore_status: pft$retained_restore_status;

    status.normal := TRUE;

    IF NOT (avp$system_administrator () OR avp$family_administrator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'system_administration or family_administration',
            status);
      RETURN; {----->
    IFEND;

    IF restore_missing_catalogs_done THEN
      restore_status := pfc$restore_missing_cat_done;
    ELSE
      restore_status := pfc$restore_missing_cat_start;
    IFEND;
    p_restore_status := #SEQ (restore_status);
    dsp$store_data_in_rdf (dsc$rdf_restore_status, dsc$rdf_production, p_restore_status);
  PROCEND pfp$set_restore_status;

?? TITLE := '  [XDCL] pfp$validate_local_family', EJECT ??
*copy pfh$validate_local_family

  PROCEDURE [XDCL] pfp$validate_local_family
    (    family_name: pft$name;
     VAR status: ost$status);

    VAR
      family_path: array [1 .. pfc$family_path_index] of pft$name;

    osp$get_set_name (family_name, family_path [pfc$set_path_index], status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    family_path [pfc$family_path_index] := family_name;

  /validate_catalog_exists/
    WHILE TRUE DO
      pfp$r2_validate_catalog_exists (family_path, status);
      IF status.normal OR (status.condition <> pfe$catalog_access_retry) THEN
        EXIT /validate_catalog_exists/; {----->
      ELSE
        pfp$catalog_access_retry_wait ('PFP$R2_VALIDATE_CATALOG_EXISTS');
      IFEND;
    WHILEND /validate_catalog_exists/;

  PROCEND pfp$validate_local_family;

?? TITLE := '  [XDCL] pfp$validate_site_options', EJECT ??
*copy pfh$validate_site_options

  PROCEDURE [XDCL, #GATE] pfp$validate_site_options
    (    family: pft$name;
         site_archive_option: pft$site_archive_option;
         site_backup_option: pft$site_backup_option;
         site_release_option: pft$site_release_option;
     VAR status: ost$status);

    VAR
      validation_control: t$validation_control;

    status.normal := TRUE;
    validation_control := c$vc_not_verified;

    IF site_archive_option <> pfc$null_site_archive_option THEN
      p$validate_site_option (family, site_archive_option, c$site_archive_options, validation_control,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    IF site_backup_option <> pfc$null_site_backup_option THEN
      p$validate_site_option (family, site_backup_option, c$site_backup_options, validation_control, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    IF site_release_option <> pfc$null_site_release_option THEN
      p$validate_site_option (family, site_release_option, c$site_release_options, validation_control,
            status);
    IFEND;

  PROCEND pfp$validate_site_options;
?? TITLE := '  [XDCL, #GATE] pfp$verify_admin_retrieval', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$verify_admin_retrieval
    (    path: pft$path;
         cycle_number: fst$cycle_number;
     VAR status: ost$status);

    CONST
      minimum_path_length = 3,
      system_privilege = TRUE;

    VAR
      authority: pft$authority,
      fs_path_size: fst$path_size,
      p_complete_path: ^pft$complete_path,
      p_fs_path: ^fst$path;

    PUSH p_complete_path: [1 .. UPPERBOUND (path) + 1];
    convert_path (path, minimum_path_length, file_path, p_complete_path^, status);

    IF status.normal THEN
      pfp$get_authority (p_complete_path^, NOT system_privilege, authority, status);
      IF status.normal THEN
        IF NOT ((pfc$system_owner IN authority.ownership) OR (pfc$family_owner IN authority.ownership)) THEN
          PUSH p_fs_path;
          pfp$convert_pf_path_to_fs_path (path, p_fs_path^, fs_path_size);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$retrieve_requires_privilege,
                p_fs_path^ (1, fs_path_size), status);
          osp$append_status_integer (osc$status_parameter_delimiter, cycle_number, radix, NOT include_radix,
                status);
        IFEND;
      IFEND;
    IFEND;

  PROCEND pfp$verify_admin_retrieval;

?? TITLE := '  [XDCL, #GATE] pfp$verify_pva', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$verify_pva
    (    pva: ^cell;
         access_mode: mmt$va_access_mode;
     VAR status: ost$status);

    CONST
      include_radix = TRUE,
      radix = 16;

    status.normal := TRUE;
    IF pva = NIL THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$nil_pointer, '', status);
      RETURN; {----->
    IFEND;

    IF NOT mmp$verify_access (^pva, access_mode) THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$invalid_or_unusable_pva, '', status);
      osp$append_status_integer (osc$status_parameter_delimiter, #RING (pva), radix, NOT include_radix,
            status);
      osp$append_status_integer (osc$status_parameter_delimiter, #SEGMENT (pva), radix, NOT include_radix,
            status);
      osp$append_status_integer (osc$status_parameter_delimiter, #OFFSET (pva), radix, NOT include_radix,
            status);
    IFEND;

  PROCEND pfp$verify_pva;
?? TITLE := '  [XDCL, #GATE] pfp$get_file_info', EJECT ??

  PROCEDURE [XDCL, #GATE] pfp$get_file_info
    (    segment: ^cell;
     VAR file_info: dmt$file_information;
     VAR status: ost$status);

    VAR
      local_info: dmt$file_information,
      sfid: gft$system_file_identifier;

    osp$verify_system_privilege;

    gfp$get_segment_sfid (segment, sfid, status);
    IF status.normal THEN
      dmp$get_file_info (sfid, local_info, status);
      IF status.normal THEN
        file_info := local_info;
      IFEND;
    IFEND;

  PROCEND pfp$get_file_info;
?? TITLE := '  Internal Procedures' ??
?? NEWTITLE := '    audit_changes', EJECT ??

  PROCEDURE audit_changes
    (    variant_path: pft$variant_path;
         cycle_number: fst$cycle_number;
         device_class: rmt$device_class;
         system_privilege: boolean;
         change_list: pft$change_list;
         last_change_attempted: ost$non_negative_integers;
         audit_status: ost$status);

    VAR
      audit_information: sft$audit_information,
      audited_object: sft$audited_fs_object_id,
      change_index: pft$array_index,
      cycle_selector: pft$cycle_selector,
      local_status: ost$status,
      local_variant_path: pft$variant_path,
      ownership: pft$ownership;

    audited_object.variant_path := variant_path;
    pfp$get_ownership (variant_path, system_privilege, ownership, local_status);

    FOR change_index := 1 TO last_change_attempted DO
      CASE change_list [change_index].change_type OF
      = pfc$pf_name_change =
        audit_information.audited_operation := sfc$ao_fs_change_name;
        audited_object.object_type := sfc$afsot_file;
        audit_information.change_fs_object_name.object_id_p := ^audited_object;
        audit_information.change_fs_object_name.ownership := ownership;
        local_variant_path.complete_path := variant_path.complete_path;
        IF variant_path.complete_path THEN
          PUSH local_variant_path.p_complete_path: [1 .. UPPERBOUND (variant_path.p_complete_path^)];
          local_variant_path.p_complete_path^ := variant_path.p_complete_path^;
          local_variant_path.p_complete_path^ [UPPERBOUND (variant_path.p_complete_path^)] :=
                change_list [change_index].pfn;
        ELSE
          PUSH local_variant_path.p_path: [1 .. UPPERBOUND (variant_path.p_path^)];
          local_variant_path.p_path^ := variant_path.p_path^;
          local_variant_path.p_path^ [UPPERBOUND (variant_path.p_path^)] := change_list [change_index].pfn;
        IFEND;
        audit_information.change_fs_object_name.new_variant_path := local_variant_path;
        sfp$emit_audit_statistic (audit_information, audit_status);

      = pfc$password_change =
        audit_information.audited_operation := sfc$ao_fs_change_attribute;
        audited_object.object_type := sfc$afsot_file;
        audit_information.change_fs_object_attribute.object_id_p := ^audited_object;
        audit_information.change_fs_object_attribute.ownership := ownership;
        audit_information.change_fs_object_attribute.attribute := sfc$afsoa_password;
        sfp$emit_audit_statistic (audit_information, audit_status);

      = pfc$cycle_number_change =
        audit_information.audited_operation := sfc$ao_fs_change_attribute;
        audited_object.object_type := sfc$afsot_cycle;
        cycle_selector.cycle_option := pfc$specific_cycle;
        cycle_selector.cycle_number := cycle_number;
        audited_object.cycle_selector_p := ^cycle_selector;
        audited_object.device_class := device_class;
        audit_information.change_fs_object_attribute.object_id_p := ^audited_object;
        audit_information.change_fs_object_attribute.ownership := ownership;
        audit_information.change_fs_object_attribute.attribute := sfc$afsoa_cycle_number;
        audit_information.change_fs_object_attribute.new_cycle_number :=
              change_list [change_index].cycle_number;
        sfp$emit_audit_statistic (audit_information, audit_status);

      = pfc$log_change =
        audit_information.audited_operation := sfc$ao_fs_change_attribute;
        audited_object.object_type := sfc$afsot_file;
        audit_information.change_fs_object_attribute.object_id_p := ^audited_object;
        audit_information.change_fs_object_attribute.ownership := ownership;
        audit_information.change_fs_object_attribute.attribute := sfc$afsoa_logging;
        audit_information.change_fs_object_attribute.logging := change_list [change_index].log = pfc$log;
        sfp$emit_audit_statistic (audit_information, audit_status);

      ELSE
        ;
      CASEND;
    FOREND;
  PROCEND audit_changes;

?? NEWTITLE := '    audit_file_changes', EJECT ??

  PROCEDURE audit_file_changes
    (    variant_path: pft$variant_path;
         cycle_number: fst$cycle_number;
         device_class: rmt$device_class;
         system_privilege: boolean;
         file_changes: fst$file_changes;
         last_change_attempted: ost$non_negative_integers;
         audit_status: ost$status);

    VAR
      audit_information: sft$audit_information,
      audited_object: sft$audited_fs_object_id,
      change_index: pft$array_index,
      cycle_selector: pft$cycle_selector,
      local_status: ost$status,
      local_variant_path: pft$variant_path,
      ownership: pft$ownership;

    audited_object.variant_path := variant_path;
    pfp$get_ownership (variant_path, system_privilege, ownership, local_status);

    FOR change_index := 1 TO last_change_attempted DO
      CASE file_changes [change_index].selector OF
      = fsc$pf_name_change =
        audit_information.audited_operation := sfc$ao_fs_change_name;
        audited_object.object_type := sfc$afsot_file;
        audit_information.change_fs_object_name.object_id_p := ^audited_object;
        audit_information.change_fs_object_name.ownership := ownership;
        local_variant_path.complete_path := variant_path.complete_path;
        IF variant_path.complete_path THEN
          PUSH local_variant_path.p_complete_path: [1 .. UPPERBOUND (variant_path.p_complete_path^)];
          local_variant_path.p_complete_path^ := variant_path.p_complete_path^;
          local_variant_path.p_complete_path^ [UPPERBOUND (variant_path.p_complete_path^)] :=
                file_changes [change_index].pfn;
        ELSE
          PUSH local_variant_path.p_path: [1 .. UPPERBOUND (variant_path.p_path^)];
          local_variant_path.p_path^ := variant_path.p_path^;
          local_variant_path.p_path^ [UPPERBOUND (variant_path.p_path^)] := file_changes [change_index].pfn;
        IFEND;
        audit_information.change_fs_object_name.new_variant_path := local_variant_path;
        sfp$emit_audit_statistic (audit_information, audit_status);

      = fsc$password_change =
        audit_information.audited_operation := sfc$ao_fs_change_attribute;
        audited_object.object_type := sfc$afsot_file;
        audit_information.change_fs_object_attribute.object_id_p := ^audited_object;
        audit_information.change_fs_object_attribute.ownership := ownership;
        audit_information.change_fs_object_attribute.attribute := sfc$afsoa_password;
        sfp$emit_audit_statistic (audit_information, audit_status);

      = fsc$cycle_number_change =
        audit_information.audited_operation := sfc$ao_fs_change_attribute;
        audited_object.object_type := sfc$afsot_cycle;
        cycle_selector.cycle_option := pfc$specific_cycle;
        cycle_selector.cycle_number := cycle_number;
        audited_object.cycle_selector_p := ^cycle_selector;
        audited_object.device_class := device_class;
        audit_information.change_fs_object_attribute.object_id_p := ^audited_object;
        audit_information.change_fs_object_attribute.ownership := ownership;
        audit_information.change_fs_object_attribute.attribute := sfc$afsoa_cycle_number;
        audit_information.change_fs_object_attribute.new_cycle_number :=
              file_changes [change_index].cycle_number;
        sfp$emit_audit_statistic (audit_information, audit_status);

      = fsc$log_change =
        audit_information.audited_operation := sfc$ao_fs_change_attribute;
        audited_object.object_type := sfc$afsot_file;
        audit_information.change_fs_object_attribute.object_id_p := ^audited_object;
        audit_information.change_fs_object_attribute.ownership := ownership;
        audit_information.change_fs_object_attribute.attribute := sfc$afsoa_logging;
        audit_information.change_fs_object_attribute.logging := file_changes [change_index].log = pfc$log;
        sfp$emit_audit_statistic (audit_information, audit_status);

      ELSE
        ;
      CASEND;
    FOREND;
  PROCEND audit_file_changes;

?? TITLE := '    audit_catalog_creation', EJECT ??

  PROCEDURE audit_catalog_creation
    (    variant_path: pft$variant_path;
         audit_ownership: audit_ownership_rec;
         audit_status: ost$status);

    VAR
      audit_information: sft$audit_information,
      audited_object: sft$audited_fs_object_id,
      ignore_status: ost$status;

    audit_information.audited_operation := sfc$ao_fs_create_object;
    audited_object.variant_path := variant_path;
    audited_object.object_type := sfc$afsot_catalog;
    audit_information.create_fs_object.object_id_p := ^audited_object;
    IF audit_ownership.ownership_known THEN
      audit_information.create_fs_object.ownership := audit_ownership.ownership;
    ELSE
      pfp$get_ownership (variant_path, audit_ownership.system_privilege,
            audit_information.create_fs_object.ownership, ignore_status);
    IFEND;
    sfp$emit_audit_statistic (audit_information, audit_status);
  PROCEND audit_catalog_creation;

?? TITLE := '    audit_catalog_deletion', SKIP := 2 ??

  PROCEDURE audit_catalog_deletion
    (    variant_path: pft$variant_path;
         system_privilege: boolean;
         audit_status: ost$status);

    VAR
      audit_information: sft$audit_information,
      audited_object: sft$audited_fs_object_id,
      ignore_status: ost$status;

    audit_information.audited_operation := sfc$ao_fs_delete_object;
    audited_object.variant_path := variant_path;
    audited_object.object_type := sfc$afsot_catalog;
    audit_information.delete_fs_object.object_id_p := ^audited_object;
    pfp$get_ownership (variant_path, system_privilege, audit_information.delete_fs_object.ownership,
          ignore_status);
    sfp$emit_audit_statistic (audit_information, audit_status);
  PROCEND audit_catalog_deletion;

?? TITLE := '    audit_cycle_creation', SKIP := 2 ??

  PROCEDURE audit_cycle_creation
    (    variant_path: pft$variant_path;
         cycle_selector: pft$cycle_selector;
         device_class: rmt$device_class;
         audit_ownership: audit_ownership_rec;
         audit_status: ost$status);

    VAR
      audit_information: sft$audit_information,
      audited_object: sft$audited_fs_object_id,
      ignore_status: ost$status,
      usage_selections: pft$usage_selections;

    audit_information.audited_operation := sfc$ao_fs_create_object;
    audited_object.variant_path := variant_path;
    audited_object.object_type := sfc$afsot_cycle;
    audited_object.cycle_selector_p := ^cycle_selector;
    audited_object.device_class := device_class;
    audit_information.create_fs_object.object_id_p := ^audited_object;
    IF audit_ownership.ownership_known THEN
      audit_information.create_fs_object.ownership := audit_ownership.ownership;
    ELSE
      pfp$get_ownership (variant_path, audit_ownership.system_privilege,
            audit_information.create_fs_object.ownership, ignore_status);
    IFEND;
    sfp$emit_audit_statistic (audit_information, audit_status);
    audit_information.audited_operation := sfc$ao_fs_attach_file;
    usage_selections := -$pft$usage_selections [];
    audit_information.attach_file.access_mode_p := ^usage_selections;
    sfp$emit_audit_statistic (audit_information, audit_status);
  PROCEND audit_cycle_creation;

?? TITLE := '    audit_cycle_restorations', SKIP := 2 ??

  PROCEDURE audit_cycle_restorations
    (    variant_path: pft$variant_path;
         ownership: pft$ownership;
         auditable_cycles: pft$auditable_cycles);

    VAR
      audit_information: sft$audit_information,
      audit_status: ost$status,
      audited_object: sft$audited_fs_object_id,
      cycle_index: pft$array_index,
      cycle_selector: pft$cycle_selector;

    audit_information.audited_operation := sfc$ao_fs_create_object;
    audited_object.variant_path := variant_path;
    audited_object.object_type := sfc$afsot_cycle;
    cycle_selector.cycle_option := pfc$specific_cycle;
    audited_object.cycle_selector_p := ^cycle_selector;
    audit_information.create_fs_object.object_id_p := ^audited_object;
    audit_information.create_fs_object.ownership := ownership;

    FOR cycle_index := 1 TO UPPERBOUND (auditable_cycles) DO
      IF auditable_cycles [cycle_index].audit THEN
        cycle_selector.cycle_number := auditable_cycles [cycle_index].cycle_number;
        audited_object.device_class := auditable_cycles [cycle_index].device_class;
        audit_status.normal := auditable_cycles [cycle_index].normal_status;
        IF NOT audit_status.normal THEN
          audit_status.condition := auditable_cycles [cycle_index].condition;
        IFEND;
        sfp$emit_audit_statistic (audit_information, audit_status);
      IFEND;
    FOREND;
  PROCEND audit_cycle_restorations;

?? TITLE := '    audit_permit_creation', SKIP := 2 ??

  PROCEDURE audit_permit_creation
    (    variant_path: pft$variant_path;
         object_type: sft$audited_fs_object_type;
         system_privilege: boolean;
         group: pft$group;
         permit_selections: pft$permit_selections;
         audit_status: ost$status);

    VAR
      audit_information: sft$audit_information,
      audited_object: sft$audited_fs_object_id,
      ignore_status: ost$status;

    audit_information.audited_operation := sfc$ao_fs_create_permit;
    audited_object.variant_path := variant_path;
    audited_object.object_type := object_type;
    audit_information.create_fs_permit.object_id_p := ^audited_object;
    pfp$get_ownership (variant_path, system_privilege, audit_information.create_fs_permit.ownership,
          ignore_status);
    audit_information.create_fs_permit.group_p := ^group;
    audit_information.create_fs_permit.permit_selections_p := ^permit_selections;
    sfp$emit_audit_statistic (audit_information, audit_status);
  PROCEND audit_permit_creation;

?? TITLE := '    audit_permit_deletion', SKIP := 2 ??

  PROCEDURE audit_permit_deletion
    (    variant_path: pft$variant_path;
         object_type: sft$audited_fs_object_type;
         system_privilege: boolean;
         group: pft$group;
         audit_status: ost$status);

    VAR
      audit_information: sft$audit_information,
      audited_object: sft$audited_fs_object_id,
      ignore_status: ost$status;

    audit_information.audited_operation := sfc$ao_fs_delete_permit;
    audited_object.variant_path := variant_path;
    audited_object.object_type := object_type;
    audit_information.delete_fs_permit.object_id_p := ^audited_object;
    pfp$get_ownership (variant_path, system_privilege, audit_information.delete_fs_permit.ownership,
          ignore_status);
    audit_information.delete_fs_permit.group_p := ^group;
    sfp$emit_audit_statistic (audit_information, audit_status);
  PROCEND audit_permit_deletion;

?? TITLE := '    audit_permit_restorations', SKIP := 2 ??

  PROCEDURE audit_permit_restorations
    (    variant_path: pft$variant_path;
         object_type: sft$audited_fs_object_type;
         ownership: pft$ownership;
         auditable_permits: pft$auditable_permits);

    VAR
      audit_information: sft$audit_information,
      audit_status: ost$status,
      audited_object: sft$audited_fs_object_id,
      permit_index: pft$array_index;

    audit_information.audited_operation := sfc$ao_fs_create_permit;
    audited_object.variant_path := variant_path;
    audited_object.object_type := object_type;
    audit_information.create_fs_permit.object_id_p := ^audited_object;
    audit_information.create_fs_permit.ownership := ownership;

    FOR permit_index := 1 TO UPPERBOUND (auditable_permits) DO
      audit_information.create_fs_permit.group_p := ^auditable_permits [permit_index].group;
      audit_information.create_fs_permit.permit_selections_p :=
            ^auditable_permits [permit_index].permit_selections;
      audit_status.normal := auditable_permits [permit_index].normal_status;
      IF NOT audit_status.normal THEN
        audit_status.condition := auditable_permits [permit_index].condition;
      IFEND;
      sfp$emit_audit_statistic (audit_information, audit_status);
    FOREND;
  PROCEND audit_permit_restorations;

?? TITLE := '    [INLINE] check_cycle_number', SKIP := 2 ??

  PROCEDURE [INLINE] check_cycle_number
    (    cycle_number: fst$cycle_number;
     VAR status: ost$status);

    IF (pfc$minimum_cycle_number <= cycle_number) AND (cycle_number <= pfc$maximum_cycle_number) THEN
      status.normal := TRUE;
    ELSE
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_cycle_number, '', status);
      osp$append_status_integer (osc$status_parameter_delimiter, cycle_number, radix, NOT include_radix,
            status);
    IFEND;
  PROCEND check_cycle_number;

?? TITLE := '    [INLINE] check_cycle_selector', SKIP := 2 ??

  PROCEDURE [INLINE] check_cycle_selector
    (    cycle_selector: pft$cycle_selector;
     VAR status: ost$status);

    CASE cycle_selector.cycle_option OF
    = pfc$lowest_cycle, pfc$highest_cycle =
      status.normal := TRUE;
    = pfc$specific_cycle =
      check_cycle_number (cycle_selector.cycle_number, status);
    ELSE
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_cycle_option, '', status);
      osp$append_status_integer (osc$status_parameter_delimiter, $INTEGER (cycle_selector.cycle_option),
            radix, NOT include_radix, status);
    CASEND;
  PROCEND check_cycle_selector;

?? TITLE := '    check_family_location', SKIP := 2 ??

  PROCEDURE check_family_location
    (    family_name: ost$family_name;
     VAR converted_family_name: ost$family_name;
     VAR served_family: boolean;
     VAR served_family_locator: pft$served_family_locator;
     VAR status: ost$status);

    VAR
      p_queue_interface_table: dft$p_queue_interface_table,
      queue_index: dft$queue_index,
      self_serving: boolean,
      server_state: dft$server_state;

    convert_family_name (family_name, catalog_path, converted_family_name, status);
    IF status.normal THEN
      served_family_locator.server_location.server_location_selector := dfc$served_family_table_index;
      dfp$locate_served_family (converted_family_name, served_family,
            served_family_locator.served_family_table_index, served_family_locator.server_mainframe_id,
            p_queue_interface_table, queue_index, server_state);
      IF served_family THEN
        served_family_locator.server_location.served_family_table_index :=
              served_family_locator.served_family_table_index;
        dfp$check_self_serving_job (served_family_locator.server_mainframe_id, self_serving);
        served_family := NOT self_serving;
        IF served_family AND (p_queue_interface_table = NIL) THEN
          { Access to a recovering server is occuring prior to the definition of the server.
          { Determine the state of the server.
          IF server_state = dfc$awaiting_recovery THEN
            { Return the status of dfe$server_not_active to allow the recovery
            { to be performed as a result of waiting for unavailable server.
            osp$set_status_abnormal (dfc$file_server_id, dfe$server_not_active, converted_family_name,
                  status);
          ELSE
            osp$set_status_abnormal (dfc$file_server_id, dfe$server_has_terminated, converted_family_name,
                  status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;
  PROCEND check_family_location;

?? TITLE := '    check_for_path_too_long', SKIP := 2 ??

  PROCEDURE check_for_path_too_long
    (    variant_path: pft$variant_path;
     VAR status: ost$status);

    VAR
      found: boolean,
      fs_path_size: fst$path_size,
      p_fs_path: ^fst$path,
      question_mark: [oss$job_paged_literal, READ] set of char := ['?'],
      scan_index: 1 .. fsc$max_path_size + 1;

    IF variant_path.complete_path THEN
      IF UPPERBOUND (variant_path.p_complete_path^) - 1 > fsc$max_path_elements THEN
        osp$set_status_condition (pfe$path_too_long, status);
      ELSEIF UPPERBOUND (variant_path.p_complete_path^) - 1 > fsc$max_path_size DIV
            (fsc$max_path_element_size + 1) THEN
        PUSH p_fs_path;
        pfp$convert_pf_path_to_fs_path (variant_path.p_complete_path^, p_fs_path^, fs_path_size);
        #SCAN (question_mark, p_fs_path^ (1, fs_path_size), scan_index, found);
        IF found THEN
          osp$set_status_condition (pfe$path_too_long, status);
        ELSE
          status.normal := TRUE;
        IFEND;
      ELSE
        status.normal := TRUE;
      IFEND;
    ELSE
      IF UPPERBOUND (variant_path.p_path^) - 1 > fsc$max_path_elements THEN
        osp$set_status_condition (pfe$path_too_long, status);
      ELSEIF UPPERBOUND (variant_path.p_path^) - 1 > fsc$max_path_size DIV
            (fsc$max_path_element_size + 1) THEN
        PUSH p_fs_path;
        pfp$convert_pft$path_to_fs_path (variant_path.p_path^, p_fs_path^, fs_path_size);
        #SCAN (question_mark, p_fs_path^ (1, fs_path_size), scan_index, found);
        IF found THEN
          osp$set_status_condition (pfe$path_too_long, status);
        ELSE
          status.normal := TRUE;
        IFEND;
      ELSE
        status.normal := TRUE;
      IFEND;
    IFEND;
  PROCEND check_for_path_too_long;

?? TITLE := '    [INLINE] check_information_request', SKIP := 2 ??

  PROCEDURE [INLINE] check_information_request
    (    information_request: fst$goi_information_request;
     VAR status: ost$status);

    IF information_request.object_information_requests <= valid_object_info_requests THEN
      status.normal := TRUE;
    ELSE
      osp$set_status_condition (pfe$bad_object_info_requests, status);
    IFEND;
  PROCEND check_information_request;

?? TITLE := '    [INLINE] check_log', SKIP := 2 ??

  PROCEDURE [INLINE] check_log
    (    log: pft$log;
     VAR status: ost$status);

    IF (log = pfc$log) OR (log = pfc$no_log) THEN
      status.normal := TRUE;
    ELSE
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_log_option, '', status);
      osp$append_status_integer (osc$status_parameter_delimiter, $INTEGER (log), radix, NOT include_radix,
            status);
    IFEND;
  PROCEND check_log;

?? TITLE := '    [INLINE] check_fs_retention', SKIP := 2 ??

  PROCEDURE [INLINE] check_fs_retention
    (    retention: fst$retention;
     VAR status: ost$status);

    CASE retention.selector OF
    = fsc$retention_day_increment =
      IF (pfc$minimum_retention <= retention.day_increment) AND
            (retention.day_increment <= pfc$maximum_retention) THEN
        status.normal := TRUE;
      ELSE
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_retention_period, '', status);
        osp$append_status_integer (osc$status_parameter_delimiter, retention.day_increment, radix,
              NOT include_radix, status);
      IFEND;
    = fsc$retention_time_increment =
      ;
    = fsc$retention_expiration_date =
      ;
    CASEND;

  PROCEND check_fs_retention;

?? TITLE := '    [INLINE] check_retention', SKIP := 2 ??

  PROCEDURE [INLINE] check_retention
    (    retention: pft$retention;
     VAR status: ost$status);

    IF (pfc$minimum_retention <= retention) AND (retention <= pfc$maximum_retention) THEN
      status.normal := TRUE;
    ELSE
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_retention_period, '', status);
      osp$append_status_integer (osc$status_parameter_delimiter, retention, radix, NOT include_radix, status);
    IFEND;
  PROCEND check_retention;

?? TITLE := '    [INLINE] check_ring', SKIP := 2 ??

  PROCEDURE [INLINE] check_ring
    (    ring: ost$valid_ring;
     VAR status: ost$status);

    IF (ring < LOWERVALUE (ring)) OR (ring > UPPERVALUE (ring)) THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_ring_number, '', status);
      osp$append_status_integer (osc$status_parameter_delimiter, ring, radix, NOT include_radix, status);
    ELSE
      status.normal := TRUE;
    IFEND;
  PROCEND check_ring;

?? TITLE := '    convert_$family', SKIP := 2 ??

  PROCEDURE convert_$family
    (VAR converted_family_name: {i/o} ost$user_name;
     VAR status: ost$status);

    VAR
      user_id: ost$user_identification;

    IF converted_family_name = '$FAMILY' THEN
      pmp$get_user_identification (user_id, status);
      pfp$process_unexpected_status (status);
      converted_family_name := user_id.family;
    ELSE
      status.normal := TRUE;
    IFEND;
  PROCEND convert_$family;

?? TITLE := '    convert_account_name', SKIP := 2 ??

  PROCEDURE convert_account_name
    (    account_name: avt$account_name;
     VAR converted_account_name: avt$account_name;
     VAR status: ost$status);

    VAR
      project: avt$project_name;

    IF account_name = osc$null_name THEN
      pmp$get_account_project (converted_account_name, project, status);
      pfp$process_unexpected_status (status);
    ELSE
      clp$validate_name (account_name, converted_account_name, status.normal);
      IF NOT status.normal THEN
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_account_name, account_name, status);
      IFEND;
    IFEND;
  PROCEND convert_account_name;

?? TITLE := '    convert_change_list', SKIP := 2 ??

  PROCEDURE convert_change_list
    (    variant_path: pft$variant_path;
         change_list: pft$change_list;
     VAR converted_change_list: pft$change_list;
     VAR status: ost$status);

    VAR
      change_index: pft$array_index,
      found: boolean,
      new_variant_path: pft$variant_path,
      space_index: 1 .. fsc$max_path_element_size + 1,
      valid_new_file_name: boolean;

    FOR change_index := 1 TO UPPERBOUND (change_list) DO
      converted_change_list [change_index] := change_list [change_index];

      CASE change_list [change_index].change_type OF
      = pfc$pf_name_change =
        clp$validate_new_file_name (change_list [change_index].pfn, converted_change_list [change_index].
              pfn, valid_new_file_name);
        IF valid_new_file_name THEN
          IF variant_path.complete_path THEN
            new_variant_path.complete_path := TRUE;
            PUSH new_variant_path.p_complete_path: [1 .. UPPERBOUND (variant_path.p_complete_path^)];
            new_variant_path.p_complete_path^ := variant_path.p_complete_path^;
            new_variant_path.p_complete_path^ [UPPERBOUND (variant_path.p_complete_path^)] :=
                  converted_change_list [change_index].pfn;
          ELSE
            new_variant_path.complete_path := FALSE;
            PUSH new_variant_path.p_path: [1 .. UPPERBOUND (variant_path.p_path^)];
            new_variant_path.p_path^ := variant_path.p_path^;
            new_variant_path.p_path^ [UPPERBOUND (variant_path.p_path^)] :=
                  converted_change_list [change_index].pfn;
          IFEND;
          check_for_path_too_long (new_variant_path, status);
        ELSE
          #SCAN (pfv$space_character, converted_change_list [change_index].pfn, space_index, found);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_permanent_file_name,
                converted_change_list [change_index].pfn (1, space_index - 1), status);
        IFEND;

      = pfc$password_change =
        pfi$convert_password (change_list [change_index].password,
              converted_change_list [change_index].password, status);

      = pfc$cycle_number_change =
        check_cycle_number (change_list [change_index].cycle_number, status);

      = pfc$retention_change =
        check_retention (change_list [change_index].retention, status);

      = pfc$log_change =
        check_log (change_list [change_index].log, status);

      = pfc$charge_change =
        status.normal := TRUE;

      = pfc$delete_damage_change =
        IF NOT (change_list [change_index].delete_damage_condition <=
              $fst$cycle_damage_symptoms [fsc$media_image_inconsistent, fsc$respf_modification_mismatch,
              fsc$parent_catalog_restored]) THEN
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$incorrect_damage_condition,
                'damage condition is unknown or unchangeable.', status);
        IFEND;

      ELSE
        osp$set_status_condition (pfe$bad_change_type, status);
        osp$append_status_integer (osc$status_parameter_delimiter,
              $INTEGER (change_list [change_index].change_type), radix, NOT include_radix, status);
      CASEND;

      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    FOREND;

    status.normal := TRUE;
  PROCEND convert_change_list;

?? TITLE := '    convert_charge_id', SKIP := 2 ??

  PROCEDURE convert_charge_id
    (    charge_id: pft$charge_id;
     VAR converted_charge_id: pft$charge_id;
     VAR status: ost$status);

    convert_account_name (charge_id.account, converted_charge_id.account, status);
    IF status.normal THEN
      convert_project_name (charge_id.project, converted_charge_id.project, status);
    IFEND;
  PROCEND convert_charge_id;

?? TITLE := '    convert_date_time', SKIP := 2 ??

  PROCEDURE convert_date_time
    (    p_date_time: ^fst$date_time;
         date_parameter_name: ost$name_reference;
     VAR converted_date_time: pft$date_time;
     VAR status: ost$status);

    VAR
      current_date_time: ost$date_time,
      local_date_time: clt$date_time,
      str: ost$string;

    IF p_date_time = NIL THEN
      converted_date_time.date_time_option := pfc$no_date_time;
      status.normal := TRUE;
    ELSE
      pfp$verify_pva (p_date_time, mmc$va_read, status);

      IF status.normal THEN
        pmp$get_compact_date_time (current_date_time, status);
      IFEND;

      IF status.normal THEN
        IF p_date_time^.value_specified THEN
          local_date_time.value := p_date_time^.date_time;
          local_date_time.time_specified := TRUE;
          local_date_time.date_specified := TRUE;
          pmp$verify_compact_date (local_date_time.value, status);

          IF status.normal THEN
            pmp$verify_compact_time (local_date_time.value, status);
          IFEND;

          IF status.normal THEN
            IF (local_date_time.value.year > current_date_time.year) OR
                  ((local_date_time.value.year = current_date_time.year) AND
                  ((local_date_time.value.month > current_date_time.month) OR
                  ((local_date_time.value.month = current_date_time.month) AND
                  ((local_date_time.value.day > current_date_time.day) OR
                  ((local_date_time.value.day = current_date_time.day) AND
                  ((local_date_time.value.hour > current_date_time.hour) OR
                  ((local_date_time.value.hour = current_date_time.hour) AND
                  ((local_date_time.value.minute > current_date_time.minute) OR
                  ((local_date_time.value.minute = current_date_time.minute) AND
                  ((local_date_time.value.second > current_date_time.second) OR
                  ((local_date_time.value.second = current_date_time.second) AND
                  ((local_date_time.value.millisecond > current_date_time.millisecond))))))))))))) THEN
              clp$convert_date_time_to_string (local_date_time, 'isod.ms', str, status);
              osp$set_status_abnormal (fsc$file_system_id, fse$unallowed_future_date_time,
                    date_parameter_name, status);
              osp$append_status_parameter (osc$status_parameter_delimiter, str.value (1, str.size), status);
            ELSE
              converted_date_time.date_time_option := pfc$specified_date_time;
              converted_date_time.specified_date_time := local_date_time.value;
              status.normal := TRUE;
            IFEND;
          IFEND;
        ELSE
          converted_date_time.date_time_option := pfc$current_date_time;
          converted_date_time.specified_date_time := current_date_time;
        IFEND;
      IFEND;
    IFEND;
  PROCEND convert_date_time;

?? TITLE := '    convert_family_name', SKIP := 2 ??

  PROCEDURE convert_family_name
    (    family_name: ost$family_name;
         path_type: path_types;
     VAR converted_family_name: ost$family_name;
     VAR status: ost$status);

    VAR
      found: boolean,
      space_index: 1 .. fsc$max_path_element_size + 1,
      user_id: ost$user_identification;

    CASE path_type OF
    = catalog_path =
      IF family_name = osc$null_name THEN
        pmp$get_user_identification (user_id, status);
        pfp$process_unexpected_status (status);
        converted_family_name := user_id.family;
      ELSE
        clp$validate_name (family_name, converted_family_name, status.normal);
        IF NOT status.normal THEN
          #SCAN (pfv$space_character, family_name, space_index, found);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_family_name,
                family_name (1, space_index - 1), status);
        IFEND;
      IFEND;

    = new_catalog_path =
      IF family_name = osc$null_name THEN
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_family_name, family_name, status);
      ELSE
        clp$validate_new_file_name (family_name, converted_family_name, status.normal);
        IF NOT status.normal THEN
          #SCAN (pfv$space_character, family_name, space_index, found);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_family_name,
                family_name (1, space_index - 1), status);
        IFEND;
      IFEND;

    ELSE
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$pf_system_error,
            'Bad path_type encountered.', status);
    CASEND;
  PROCEND convert_family_name;

?? TITLE := '    convert_file_changes', SKIP := 2 ??

  PROCEDURE convert_file_changes
    (    variant_path: pft$variant_path;
         file_changes: ^fst$file_changes;
     VAR converted_file_changes: ^fst$file_changes;
     VAR status: ost$status);

    VAR
      change_index: pft$array_index,
      family: pft$name,
      found: boolean,
      new_variant_path: pft$variant_path,
      site_archive_option: pft$site_archive_option,
      site_backup_option: pft$site_backup_option,
      site_release_option: pft$site_release_option,
      space_index: 1 .. fsc$max_path_element_size + 1,
      valid_new_file_name: boolean;

    status.normal := TRUE;
    site_archive_option := pfc$null_site_archive_option;
    site_backup_option := pfc$null_site_backup_option;
    site_release_option := pfc$null_site_release_option;

    FOR change_index := 1 TO UPPERBOUND (file_changes^) DO
      converted_file_changes^ [change_index] := file_changes^ [change_index];

      CASE file_changes^ [change_index].selector OF
      = fsc$charge_change =
        ;
      = fsc$cycle_number_change =
        check_cycle_number (file_changes^ [change_index].cycle_number, status);

      = fsc$delete_damage_change =
        IF NOT (file_changes^ [change_index].delete_damage_condition <=
              $fst$cycle_damage_symptoms [fsc$media_image_inconsistent, fsc$respf_modification_mismatch,
              fsc$parent_catalog_restored]) THEN
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$incorrect_damage_condition,
                'damage condition is unknown or unchangeable.', status);
        IFEND;

      = fsc$log_change =
        check_log (file_changes^ [change_index].log, status);

      = fsc$null_file_change =
        ;

      = fsc$password_change =
        pfi$convert_password (file_changes^ [change_index].password,
              converted_file_changes^ [change_index].password, status);

      = fsc$pf_name_change =
        clp$validate_new_file_name (file_changes^ [change_index].pfn,
              converted_file_changes^ [change_index].pfn, valid_new_file_name);
        IF valid_new_file_name THEN
          IF variant_path.complete_path THEN
            new_variant_path.complete_path := TRUE;
            PUSH new_variant_path.p_complete_path: [1 .. UPPERBOUND (variant_path.p_complete_path^)];
            new_variant_path.p_complete_path^ := variant_path.p_complete_path^;
            new_variant_path.p_complete_path^ [UPPERBOUND (variant_path.p_complete_path^)] :=
                  converted_file_changes^ [change_index].pfn;
          ELSE
            new_variant_path.complete_path := FALSE;
            PUSH new_variant_path.p_path: [1 .. UPPERBOUND (variant_path.p_path^)];
            new_variant_path.p_path^ := variant_path.p_path^;
            new_variant_path.p_path^ [UPPERBOUND (variant_path.p_path^)] :=
                  converted_file_changes^ [change_index].pfn;
          IFEND;
          check_for_path_too_long (new_variant_path, status);
        ELSE
          #SCAN (pfv$space_character, converted_file_changes^ [change_index].pfn, space_index, found);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_permanent_file_name,
                converted_file_changes^ [change_index].pfn (1, space_index - 1), status);
        IFEND;

      = fsc$retention_change =
        check_fs_retention (file_changes^ [change_index].retention, status);
      = fsc$retrieve_option_change =
        ;
      = fsc$shared_queue_change =
        ;
      = fsc$site_archive_option_change =
        site_archive_option := file_changes^ [change_index].site_archive_option;
      = fsc$site_backup_option_change =
        site_backup_option := file_changes^ [change_index].site_backup_option;
      = fsc$site_release_option_change =
        site_release_option := file_changes^ [change_index].site_release_option;

      ELSE
        osp$set_status_condition (pfe$bad_change_type, status);
        osp$append_status_integer (osc$status_parameter_delimiter,
              $INTEGER (file_changes^ [change_index].selector), radix, NOT include_radix, status);
      CASEND;

      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    FOREND;

    IF variant_path.complete_path THEN
      family := variant_path.p_complete_path^ [pfc$family_path_index];
    ELSE
      family := variant_path.p_path^ [pfc$family_name_index];
    IFEND;
    pfp$validate_site_options (family, site_archive_option, site_backup_option, site_release_option, status);

  PROCEND convert_file_changes;

?? TITLE := '    convert_group', SKIP := 2 ??

  PROCEDURE convert_group
    (    group: pft$group;
         creating_permit: boolean;
     VAR converted_group: pft$group;
     VAR status: ost$status);

    converted_group.group_type := group.group_type;
    CASE group.group_type OF
    = pfc$public =
      status.normal := TRUE;

    = pfc$family =
      convert_family_name (group.family_description.family, catalog_path,
            converted_group.family_description.family, status);
      IF status.normal AND creating_permit THEN
        convert_$family (converted_group.family_description.family, status);
      IFEND;

    = pfc$account =
      convert_family_name (group.account_description.family, catalog_path,
            converted_group.account_description.family, status);
      IF status.normal AND creating_permit THEN
        convert_$family (converted_group.family_description.family, status);
      IFEND;
      IF status.normal THEN
        convert_account_name (group.account_description.account, converted_group.account_description.account,
              status);
      IFEND;

    = pfc$project =
      convert_family_name (group.project_description.family, catalog_path,
            converted_group.project_description.family, status);
      IF status.normal AND creating_permit THEN
        convert_$family (converted_group.family_description.family, status);
      IFEND;
      IF status.normal THEN
        convert_account_name (group.project_description.account, converted_group.project_description.account,
              status);
        IF status.normal THEN
          convert_project_name (group.project_description.project,
                converted_group.project_description.project, status);
        IFEND;
      IFEND;

    = pfc$user =
      convert_family_name (group.user_description.family, catalog_path,
            converted_group.user_description.family, status);
      IF status.normal AND creating_permit THEN
        convert_$family (converted_group.family_description.family, status);
      IFEND;
      IF status.normal THEN
        convert_user_name (group.user_description.user, creating_permit,
              converted_group.user_description.user, status);
      IFEND;

    = pfc$user_account =
      convert_family_name (group.user_account_description.family, catalog_path,
            converted_group.user_account_description.family, status);
      IF status.normal AND creating_permit THEN
        convert_$family (converted_group.family_description.family, status);
      IFEND;
      IF status.normal THEN
        convert_account_name (group.user_account_description.account,
              converted_group.user_account_description.account, status);
        IF status.normal THEN
          convert_user_name (group.user_account_description.user, creating_permit,
                converted_group.user_account_description.user, status);
        IFEND;
      IFEND;

    = pfc$member =
      convert_family_name (group.member_description.family, catalog_path,
            converted_group.member_description.family, status);
      IF status.normal AND creating_permit THEN
        convert_$family (converted_group.family_description.family, status);
      IFEND;
      IF status.normal THEN
        convert_account_name (group.member_description.account, converted_group.member_description.account,
              status);
        IF status.normal THEN
          convert_project_name (group.member_description.project, converted_group.member_description.project,
                status);
          IF status.normal THEN
            convert_user_name (group.member_description.user, creating_permit,
                  converted_group.member_description.user, status);
          IFEND;
        IFEND;
      IFEND;

    ELSE
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_group_type, '', status);
      osp$append_status_integer (osc$status_parameter_delimiter, $INTEGER (group.group_type), radix,
            NOT include_radix, status);
    CASEND;
  PROCEND convert_group;

?? TITLE := '    convert_lfn', SKIP := 2 ??

  PROCEDURE convert_lfn
    (    lfn: amt$local_file_name;
     VAR converted_lfn: amt$local_file_name;
     VAR status: ost$status);

    VAR
      found: boolean,
      space_index: 1 .. fsc$max_path_element_size + 1;

    clp$validate_new_file_name (lfn, converted_lfn, status.normal);
    IF NOT status.normal THEN
      #SCAN (pfv$space_character, lfn, space_index, found);
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_local_file_name,
            lfn (1, space_index - 1), status);
    IFEND;
  PROCEND convert_lfn;

?? TITLE := '    convert_master_catalog_name', SKIP := 2 ??

  PROCEDURE convert_master_catalog_name
    (    master_catalog_name: pft$name;
         path_type: path_types;
     VAR converted_master_catalog_name: pft$name;
     VAR status: ost$status);

    CONST
      system_user_name = '$SYSTEM';

    VAR
      found: boolean,
      space_index: 1 .. fsc$max_path_element_size + 1,
      user_id: ost$user_identification;

    CASE path_type OF
    = catalog_path =
      IF master_catalog_name = osc$null_name THEN
        pmp$get_user_identification (user_id, status);
        pfp$process_unexpected_status (status);
        converted_master_catalog_name := user_id.user;
      ELSE
        clp$validate_name (master_catalog_name, converted_master_catalog_name, status.normal);
        IF NOT status.normal THEN
          #SCAN (pfv$space_character, master_catalog_name, space_index, found);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_master_catalog_name,
                master_catalog_name (1, space_index - 1), status);
        IFEND;
      IFEND;

    = new_catalog_path =
      IF master_catalog_name = osc$null_name THEN
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_master_catalog_name,
              master_catalog_name, status);
      ELSEIF master_catalog_name = system_user_name THEN
        converted_master_catalog_name := master_catalog_name;
        status.normal := TRUE;
      ELSE
        clp$validate_new_file_name (master_catalog_name, converted_master_catalog_name, status.normal);
        IF NOT status.normal THEN
          #SCAN (pfv$space_character, master_catalog_name, space_index, found);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_master_catalog_name,
                master_catalog_name (1, space_index - 1), status);
        IFEND;
      IFEND;

    ELSE
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$pf_system_error,
            'Bad path_type encountered.', status);
    CASEND;
  PROCEND convert_master_catalog_name;

?? TITLE := '    [INLINE] convert_password_selector', SKIP := 2 ??

  PROCEDURE [INLINE] convert_password_selector
    (    password_selector: pft$password_selector;
     VAR converted_password_selector: pft$password_selector;
     VAR status: ost$status);

    IF password_selector.password_specified = pfc$default_password_option THEN
      converted_password_selector := password_selector;
      status.normal := TRUE;
    ELSEIF password_selector.password_specified = pfc$specific_password_option THEN
      IF password_selector.password = osc$null_name THEN
        converted_password_selector := password_selector;
        status.normal := TRUE;
      ELSE
        converted_password_selector.password_specified := pfc$specific_password_option;
        clp$validate_name (password_selector.password, converted_password_selector.password, status.normal);
        IF NOT status.normal THEN
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_password,
                password_selector.password, status);
        IFEND;
      IFEND;
    ELSE
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_password,
            'bad password_specified option', status);
    IFEND;
  PROCEND convert_password_selector;

?? TITLE := '    convert_path', SKIP := 2 ??

  PROCEDURE convert_path
    (    path: pft$path;
         minimum_path_length: integer;
         path_type: path_types;
     VAR converted_path: pft$complete_path;
     VAR status: ost$status);

    VAR
      found: boolean,
      fs_path: fst$path,
      fs_path_size: fst$path_size,
      new_path_index: integer,
      p_new_path: pft$p_complete_path,
      path_index: integer,
      path_length: integer,
      space_index: 1 .. fsc$max_path_element_size + 1;

    path_length := UPPERBOUND (path);

    convert_family_name (path [pfc$family_name_index], catalog_path, converted_path [pfc$family_path_index],
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF path_length > pfc$family_name_index THEN
      convert_master_catalog_name (path [pfc$master_catalog_name_index],
            catalog_path, converted_path [pfc$master_catalog_path_index], status);
      IF status.normal THEN
        osp$get_set_name (converted_path [pfc$family_path_index], converted_path [pfc$set_path_index],
              status);
      ELSE
        RETURN; {----->
      IFEND;
    ELSE
      osp$get_set_name (path [pfc$family_name_index], converted_path [pfc$set_path_index], status);
    IFEND;
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF path_length < minimum_path_length THEN
      PUSH p_new_path: [1 .. path_length + 1];
      IF path_length > pfc$family_name_index THEN
        p_new_path^ [pfc$set_path_index] := converted_path [pfc$set_path_index];
      IFEND;
      FOR path_index := pfc$family_path_index TO path_length + 1 DO
        p_new_path^ [path_index] := converted_path [path_index];
      FOREND;
      pfp$convert_pf_path_to_fs_path (p_new_path^, fs_path, fs_path_size);
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$path_too_short, fs_path (1, fs_path_size),
            status);
      osp$append_status_integer (osc$status_parameter_delimiter, minimum_path_length, radix,
            NOT include_radix, status);
      CASE path_type OF
      = catalog_path, new_catalog_path =
        osp$append_status_parameter (osc$status_parameter_delimiter, 'catalog', status);
      = file_path, new_file_path =
        osp$append_status_parameter (osc$status_parameter_delimiter, 'file', status);
      = item_path, new_item_path =
        osp$append_status_parameter (osc$status_parameter_delimiter, 'catalog/file', status);
      CASEND;
      RETURN; {----->
    IFEND;

    IF path_length > pfc$master_catalog_name_index THEN
      FOR path_index := pfc$subcatalog_name_index TO path_length - 1 DO
        clp$validate_name (path [path_index], converted_path [path_index + 1], status.normal);
        IF NOT status.normal THEN
          PUSH p_new_path: [1 .. path_index + 1];
          FOR new_path_index := pfc$set_path_index TO path_index DO
            p_new_path^ [new_path_index] := converted_path [new_path_index];
          FOREND;
          p_new_path^ [path_index + 1] := path [path_index];
          pfp$convert_pf_path_to_fs_path (p_new_path^, fs_path, fs_path_size);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_nth_subcatalog_name,
                fs_path (1, fs_path_size), status);
          RETURN; {----->
        IFEND;
      FOREND;

      CASE path_type OF
      = catalog_path, item_path =
        clp$validate_name (path [path_length], converted_path [path_length + 1], status.normal);
        IF NOT status.normal THEN
          PUSH p_new_path: [1 .. path_length + 1];
          FOR path_index := pfc$set_path_index TO path_length DO
            p_new_path^ [path_index] := converted_path [path_index];
          FOREND;
          p_new_path^ [path_length + 1] := path [path_length];
          pfp$convert_pf_path_to_fs_path (p_new_path^, fs_path, fs_path_size);
          IF path_type = catalog_path THEN
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_last_subcatalog_name,
                  fs_path (1, fs_path_size), status);
          ELSE
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_item_name,
                  fs_path (1, fs_path_size), status);
          IFEND;
        IFEND;

      = file_path =
        clp$validate_name (path [path_length], converted_path [path_length + 1], status.normal);
        IF NOT status.normal THEN
          #SCAN (pfv$space_character, path [path_length], space_index, found);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_permanent_file_name,
                path [path_length] (1, space_index - 1), status);
        IFEND;

      = new_catalog_path, new_file_path, new_item_path =
        clp$validate_new_file_name (path [path_length], converted_path [path_length + 1], status.normal);
        IF NOT status.normal THEN
          #SCAN (pfv$space_character, path [path_length], space_index, found);
          CASE path_type OF
          = new_catalog_path =
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_last_subcatalog_name,
                  path [path_length] (1, space_index - 1), status);
          = new_file_path =
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_permanent_file_name,
                  path [path_length] (1, space_index - 1), status);
          ELSE
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_item_name, path [path_length] (1,
                  space_index - 1), status);
          CASEND;
        IFEND;

      ELSE
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$pf_system_error,
              'Bad path_type encountered.', status);
      CASEND;
    IFEND;
  PROCEND convert_path;

?? TITLE := '    convert_path_without_set', SKIP := 2 ??

  PROCEDURE convert_path_without_set
    (    path: pft$path;
         converted_family_name: pft$name;
         minimum_path_length: integer;
         path_type: path_types;
     VAR converted_path: pft$complete_path;
     VAR status: ost$status);

    VAR
      found: boolean,
      fs_path: fst$path,
      fs_path_size: fst$path_size,
      new_path_index: integer,
      path_index: integer,
      path_length: integer,
      space_index: 1 .. fsc$max_path_element_size + 1,
      user_id: ost$user_identification;

    path_length := UPPERBOUND (path);

    converted_path [pfc$family_name_index] := converted_family_name;

    IF path_length > pfc$family_name_index THEN
      convert_master_catalog_name (path [pfc$master_catalog_name_index],
            catalog_path, converted_path [pfc$master_catalog_name_index], status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    IF path_length < minimum_path_length THEN
      pfp$convert_pft$path_to_fs_path (path, fs_path, fs_path_size);
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$path_too_short, fs_path (1, fs_path_size),
            status);
      osp$append_status_integer (osc$status_parameter_delimiter, minimum_path_length, radix,
            NOT include_radix, status);
      CASE path_type OF
      = catalog_path, new_catalog_path =
        osp$append_status_parameter (osc$status_parameter_delimiter, 'catalog', status);
      = file_path, new_file_path =
        osp$append_status_parameter (osc$status_parameter_delimiter, 'file', status);
      = item_path, new_item_path =
        osp$append_status_parameter (osc$status_parameter_delimiter, 'catalog/file', status);
      CASEND;
      RETURN; {----->
    IFEND;

    IF path_length > pfc$master_catalog_name_index THEN
      FOR path_index := pfc$subcatalog_name_index TO path_length - 1 DO
        clp$validate_name (path [path_index], converted_path [path_index], status.normal);
        IF NOT status.normal THEN
          pfp$convert_pft$path_to_fs_path (path, fs_path, fs_path_size);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_nth_subcatalog_name,
                fs_path (1, fs_path_size), status);
          RETURN; {----->
        IFEND;
      FOREND;

      CASE path_type OF
      = catalog_path, item_path =
        clp$validate_name (path [path_length], converted_path [path_length], status.normal);
        IF NOT status.normal THEN
          pfp$convert_pft$path_to_fs_path (path, fs_path, fs_path_size);
          IF path_type = catalog_path THEN
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_last_subcatalog_name,
                  fs_path (1, fs_path_size), status);
          ELSE
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_item_name,
                  fs_path (1, fs_path_size), status);
          IFEND;
        IFEND;

      = file_path =
        clp$validate_name (path [path_length], converted_path [path_length], status.normal);
        IF NOT status.normal THEN
          #SCAN (pfv$space_character, path [path_length], space_index, found);
          osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_permanent_file_name,
                path [path_length] (1, space_index - 1), status);
        IFEND;

      = new_catalog_path, new_file_path, new_item_path =
        clp$validate_new_file_name (path [path_length], converted_path [path_length], status.normal);
        IF NOT status.normal THEN
          #SCAN (pfv$space_character, path [path_length], space_index, found);
          CASE path_type OF
          = new_catalog_path =
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_last_subcatalog_name,
                  path [path_length] (1, space_index - 1), status);
          = new_file_path =
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_permanent_file_name,
                  path [path_length] (1, space_index - 1), status);
          ELSE
            osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_item_name, path [path_length] (1,
                  space_index - 1), status);
          CASEND;
        IFEND;

      ELSE
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$pf_system_error,
              'Bad path_type encountered.', status);
      CASEND;
    IFEND;
  PROCEND convert_path_without_set;

?? TITLE := '    convert_project_name', SKIP := 2 ??

  PROCEDURE convert_project_name
    (    project_name: avt$project_name;
     VAR converted_project_name: avt$project_name;
     VAR status: ost$status);

    VAR
      account: avt$account_name;

    IF project_name = osc$null_name THEN
      pmp$get_account_project (account, converted_project_name, status);
      pfp$process_unexpected_status (status);
    ELSE
      clp$validate_name (project_name, converted_project_name, status.normal);
      IF NOT status.normal THEN
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_project_name, project_name, status);
      IFEND;
    IFEND;
  PROCEND convert_project_name;

?? TITLE := '    convert_usage_and_share_selects', SKIP := 2 ??

  PROCEDURE convert_usage_and_share_selects
    (    usage_selections: pft$usage_selections;
         share_selections: pft$share_selections;
     VAR converted_usage_selections: pft$usage_selections;
     VAR converted_share_selections: pft$share_selections);

    VAR
      share_option: pft$share_options,
      usage_option: pft$usage_options;

    converted_usage_selections := $pft$usage_selections [];
    converted_share_selections := $pft$share_selections [];

    FOR usage_option := LOWERVALUE (usage_option) TO UPPERVALUE (usage_option) DO
      IF usage_option IN usage_selections THEN
        converted_usage_selections := converted_usage_selections + $pft$usage_selections [usage_option];
      IFEND;
    FOREND;

    FOR share_option := LOWERVALUE (share_option) TO UPPERVALUE (share_option) DO
      IF share_option IN share_selections THEN
        converted_share_selections := converted_share_selections + $pft$share_selections [share_option];
      IFEND;
    FOREND;
  PROCEND convert_usage_and_share_selects;

?? TITLE := '    [INLINE] convert_set_name', SKIP := 2 ??

  PROCEDURE [INLINE] convert_set_name
    (    family_name: ost$family_name;
     VAR converted_set_name: stt$set_name;
     VAR status: ost$status);

    VAR
      converted_family_name: ost$family_name;

    clp$validate_name (family_name, converted_family_name, status.normal);
    IF NOT status.normal THEN
      osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_family_name, family_name, status);
    ELSE
      osp$get_set_name (converted_family_name, converted_set_name, status);
    IFEND;
  PROCEND convert_set_name;

?? TITLE := '    convert_user_name', SKIP := 2 ??

  PROCEDURE convert_user_name
    (    user_name: ost$user_name;
         creating_permit: boolean;
     VAR converted_user_name: ost$user_name;
     VAR status: ost$status);

    VAR
      user_id: ost$user_identification;

    IF user_name = osc$null_name THEN
      pmp$get_user_identification (user_id, status);
      pfp$process_unexpected_status (status);
      converted_user_name := user_id.user;
    ELSE
      clp$validate_name (user_name, converted_user_name, status.normal);
      IF status.normal THEN
        IF (converted_user_name = '$USER') AND creating_permit THEN
          pmp$get_user_identification (user_id, status);
          pfp$process_unexpected_status (status);
          converted_user_name := user_id.user;
        IFEND;
      ELSE
        osp$set_status_abnormal (pfc$permanent_file_manager_id, pfe$bad_user_name, user_name, status);
      IFEND;
    IFEND;
  PROCEND convert_user_name;

?? TITLE := '    convert_validation_criteria', SKIP := 2 ??

  PROCEDURE convert_validation_criteria
    (    caller_id: ost$caller_identifier;
         p_validation_criteria: {input} ^fst$goi_validation_criteria;
         p_converted_validation_criteria: {output^} ^fst$goi_validation_criteria;
     VAR password_selector: pft$password_selector;
     VAR subject_permit_count: ost$non_negative_integers;
     VAR validation_ring: ost$valid_ring;
     VAR status: ost$status);

    VAR
      criterion_index: ost$positive_integers,
      local_group: pft$group,
      min_ring: ost$valid_ring,
      password_found: boolean,
      validation_ring_found: boolean;

    password_found := FALSE;
    password_selector.password_specified := pfc$default_password_option;
    subject_permit_count := 0;
    validation_ring_found := FALSE;
    min_ring := avp$ring_min ();
    IF caller_id.ring <= min_ring THEN
      validation_ring := caller_id.ring;
    ELSE
      validation_ring := min_ring;
    IFEND;

    p_converted_validation_criteria^ := p_validation_criteria^;

    FOR criterion_index := 1 TO UPPERBOUND (p_converted_validation_criteria^) DO
      CASE p_converted_validation_criteria^ [criterion_index].validation_selection OF
      = fsc$goi_password =
        IF NOT password_found THEN
          password_found := TRUE;
          password_selector.password_specified := pfc$specific_password_option;
          pfi$convert_password (p_converted_validation_criteria^ [criterion_index].password,
                password_selector.password, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;

      = fsc$goi_subject_permit =
        convert_group (p_converted_validation_criteria^ [criterion_index].subject_permit.group,
              {creating_permit} FALSE, local_group, status);
        IF status.normal THEN
          p_converted_validation_criteria^ [criterion_index].subject_permit.group := local_group;
          subject_permit_count := subject_permit_count + 1;
        ELSE
          RETURN; {----->
        IFEND;

      = fsc$goi_validation_ring =
        IF NOT validation_ring_found THEN
          validation_ring_found := TRUE;
          IF validation_ring <= p_converted_validation_criteria^ [criterion_index].validation_ring THEN
            validation_ring := p_converted_validation_criteria^ [criterion_index].validation_ring;
          ELSEIF p_converted_validation_criteria^ [criterion_index].validation_ring < validation_ring THEN
            osp$set_status_condition (pfe$bad_ring_number, status);
            osp$append_status_integer (osc$status_parameter_delimiter,
                  p_converted_validation_criteria^ [criterion_index].validation_ring, radix,
                  NOT include_radix, status);
            RETURN; {----->
          IFEND;
        IFEND;

      ELSE
        osp$set_status_condition (pfe$bad_validation_selection, status);
        osp$append_status_integer (osc$status_parameter_delimiter,
              $INTEGER (p_converted_validation_criteria^ [criterion_index].validation_selection), radix,
              NOT include_radix, status);
        RETURN; {----->
      CASEND;
    FOREND;
  PROCEND convert_validation_criteria;

?? OLDTITLE ??
?? NEWTITLE := ' emit_out_of_space_menu', EJECT ??
{ PURPOSE:
{   The purpose of this procedure is to present a menu to the operator
{   when MOVE_CLASSES cannot move files or catalogs because sufficient mass
{   storage space is not available.
{

  PROCEDURE emit_out_of_space_menu
    (    object_type_string: string ( * ),
         set_name: ost$name;
         path: pft$path;
         mass_storage_class: string (1);
         allocated_size: integer;
         reason_for_move_failure: pft$reason_for_move_failure;
     VAR operator_response: pft$mo_operator_response);

    CONST
      number_of_choices = 3;

    VAR
      int_string: ost$string,
      local_status: ost$status,
      message_parameters: array [1 .. 6] of ^ost$message_parameter,
      p_path_string: ^ost$string,
      parameter_names: ^ost$parameter_help_names,
      response: oft$number_of_choices,
      response_string: ost$string,
      system_job_name: jmt$system_supplied_name,
      user_job_name: jmt$user_supplied_name;

    operator_response := pfc$terminate_command;

    message_parameters [1] := ^object_type_string;
    pmp$get_job_names (user_job_name, system_job_name, local_status);
    IF NOT local_status.normal THEN
      RETURN; {----->
    IFEND;

    message_parameters [2] := ^system_job_name;
    message_parameters [3] := ^mass_storage_class;
    message_parameters [4] := ^set_name;

    PUSH p_path_string;
    pfp$convert_pft$path_to_string (path, p_path_string^);
    message_parameters [5] := ^p_path_string^.value (1, p_path_string^.size);

    int_string.value := ' ';
    clp$convert_integer_to_string (allocated_size, {radix} 10, {include_radix} FALSE, int_string,
          local_status);
    IF local_status.normal THEN
      message_parameters [6] := ^int_string.value;
    ELSE
      message_parameters [6] := NIL;
    IFEND;

    PUSH parameter_names: [1 .. number_of_choices];
    parameter_names^ [1] := 'RETRY_MOVE';
    parameter_names^ [2] := 'SKIP_OBJECT';
    parameter_names^ [3] := 'TERMINATE_COMMAND';

    IF reason_for_move_failure = pfc$insufficient_space THEN
      ofp$format_operator_menu (pfc$movc_insuf_space, parameter_names, ^message_parameters, number_of_choices,
            ofc$system_operator, response, response_string, local_status);
      IF NOT local_status.normal THEN
        RETURN; {----->
      IFEND;
    ELSEIF reason_for_move_failure = pfc$no_available_space THEN
      ofp$format_operator_menu (pfc$movc_no_space, parameter_names, ^message_parameters, number_of_choices,
            ofc$system_operator, response, response_string, local_status);
      IF NOT local_status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    IF response = 1 THEN {retry allocation}
      operator_response := pfc$retry_move;
    ELSEIF response = 2 THEN {skip object}
      operator_response := pfc$skip_object;
    ELSEIF response = 3 THEN {terminate command}
      operator_response := pfc$terminate_command;
    IFEND;

  PROCEND emit_out_of_space_menu;

?? OLDTITLE ??
?? NEWTITLE := 'update_set_volume_list', EJECT ??
{ PURPOSE:
{   The purpose of this procedure is to update the mass storage class
{   information contained in the MOVE_CLASSES SET_VOLUME_LIST.
{

  PROCEDURE update_set_volume_list
    (    set_volume_list_p: ^pft$mo_volume_list);

    VAR
      found: boolean,
      i: integer,
      j: integer,
      ms_volume_count: integer,
      ms_volumes_p: ^array [1 .. * ] of cmt$mass_storage_volume;

    IF set_volume_list_p = NIL THEN
      RETURN; {----->
    IFEND;

    { Obtain the class membership of each volume in the configuration which is ON and ENABLED.

    cmp$get_ms_volumes (ms_volume_count);
    PUSH ms_volumes_p: [1 .. ms_volume_count];
    cmp$get_ms_volume_info (ms_volumes_p^);

    FOR i := 1 TO UPPERBOUND (set_volume_list_p^) DO
      found := FALSE;

    /locate_volume/
      FOR j := 1 TO ms_volume_count DO
        IF set_volume_list_p^ [i].recorded_vsn = ms_volumes_p^ [j].recorded_vsn THEN
          found := TRUE;
          EXIT /locate_volume/; {----->
        IFEND;
      FOREND /locate_volume/;

      IF found THEN
        set_volume_list_p^ [i].ms_class := ms_volumes_p^ [j].class;
      IFEND;
    FOREND;

  PROCEND update_set_volume_list;

?? OLDTITLE, OLDTITLE, SKIP := 2 ??
MODEND pfm$program_interface_processor;
